diff --git a/lua/CopilotChat/health.lua b/lua/CopilotChat/health.lua index 91edf50b..4166a097 100644 --- a/lua/CopilotChat/health.lua +++ b/lua/CopilotChat/health.lua @@ -41,20 +41,19 @@ end function M.check() start('CopilotChat.nvim [core]') - local vim_version = vim.api.nvim_command_output('version') - local is_good_stable = vim.fn.has('nvim-0.9.5') == 1 or vim.fn.has('nvim-0.10.0') == 1 - + local vim_version = vim.trim(vim.api.nvim_command_output('version')) local dev_number = tonumber(vim_version:match('dev%-(%d+)')) if dev_number then - if dev_number >= 2500 then + local to_check = vim.fn.has('nvim-0.11.0') and 0 or 2500 + if dev_number >= to_check then ok('nvim: ' .. vim_version) else error( 'nvim: outdated, please upgrade to a up to date nightly version. See "https://github.com/neovim/neovim".' ) end - elseif is_good_stable then + elseif vim.fn.has('nvim-0.9.5') == 1 then ok('nvim: ' .. vim_version) else error('nvim: unsupported, please upgrade to 0.9.5 or later. See "https://neovim.io/".')