Skip to content

Commit

Permalink
fix: Use proper commit numbers since last release for nvim version check
Browse files Browse the repository at this point in the history
Signed-off-by: Tomas Slusny <[email protected]>
  • Loading branch information
deathbeam committed May 24, 2024
1 parent 75b2ece commit feca60c
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lua/CopilotChat/health.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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/".')
Expand Down

0 comments on commit feca60c

Please sign in to comment.