diff options
Diffstat (limited to 'init.lua')
| -rw-r--r-- | init.lua | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -11,14 +11,16 @@ -- StackOverflow: https://stackoverflow.com/users/6064933/jdhao local api = vim.api -local utils = require("utils") +local version = vim.version -- check if we have the latest stable version of nvim -local expected_ver = "0.8.3" -local nvim_ver = utils.get_nvim_version() +local expected_ver = "0.9.0" +local ev = version.parse(expected_ver) +local actual_ver = version() -if nvim_ver ~= expected_ver then - local msg = string.format("Unsupported nvim version: expect %s, but got %s instead!", expected_ver, nvim_ver) +if version.cmp(ev, actual_ver) ~= 0 then + local _ver = string.format("%s.%s.%s", actual_ver.major, actual_ver.minor, actual_ver.patch) + local msg = string.format("Unsupported nvim version: expect %s, but got %s instead!", expected_ver, _ver) api.nvim_err_writeln(msg) return end |
