Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: Specify supported Neovim version #99

Open
rsynnest opened this issue Jun 26, 2024 · 1 comment
Open

Suggestion: Specify supported Neovim version #99

rsynnest opened this issue Jun 26, 2024 · 1 comment

Comments

@rsynnest
Copy link

Yo! Thank you for making this ❤️

I recently updated navbuddy, and it errored out my neovim due to this change:
06525d0

That update totally makes sense to target the latest Neovim API, but if users are on an old version it might be tricky to figure out why it's broken.

I had an idea that it might be useful to add a version check like the following:

if not (nvim_version.major == 0 and nvim_version.minor >= 10) then
  vim.api.nvim_err_writeln("WARNING: nvim-navbuddy requires Neovim v0.10.0 or higher.")
end

I think it's good to continue to run the plugin even if it's on an unsupported neovim, because it will still throw a loud message if it encounters an error.

This check may also be annoying since you would need to manually keep it up to date. But, at least it gives the user some extra information about why something might be failing, and what version the plugin is tested against. Feel free to use it or not, just an idea I'm toying with.

Thanks!

@rsynnest
Copy link
Author

rsynnest commented Jul 1, 2024

Maybe a better idea is to fallback to the old function if nvim version isn't new enough:

if vim.fn.has('nvim-0.10') == 0 then
	local all_clients = vim.lsp.get_clients()
else
	local all_clients = vim.lsp.get_active_clients()
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant