Skip to content

Commit

Permalink
upgrade neovim to latest stable
Browse files Browse the repository at this point in the history
The way to compare versions are changed due to a bug in comparing
versions in the neovim core: neovim/neovim#28782
  • Loading branch information
jdhao committed May 20, 2024
1 parent e462ebc commit 601396f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ vim.loader.enable()
local version = vim.version

-- check if we have the latest stable version of nvim
local expected_ver = "0.9.5"
local expected_ver = "0.10.0"
local ev = version.parse(expected_ver)
local actual_ver = version()

if version.cmp(ev, actual_ver) ~= 0 then
local result = version.cmp(ev, {actual_ver.major, actual_ver.minor, actual_ver.patch})

if result ~= 0 then
local _ver = string.format("%s.%s.%s", actual_ver.major, actual_ver.minor, actual_ver.patch)
local msg = string.format("Expect nvim %s, but got %s instead. Use at your own risk!", expected_ver, _ver)
vim.api.nvim_err_writeln(msg)
Expand Down

0 comments on commit 601396f

Please sign in to comment.