aboutsummaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
authorjdhao <jdhao@hotmail.com>2023-04-07 22:42:24 +0200
committerGitHub <noreply@github.com>2023-04-08 04:42:24 +0800
commit644993a89e8be251c10f4d2b1bb761301f4545b1 (patch)
tree5e796f10ad4ea784c8c733a439d64ec2f39f0011 /init.lua
parent8746c7eb11f368efb90226f8a49eec57764ba06a (diff)
bump to nvim version 0.9.0 (#188)
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua12
1 files changed, 7 insertions, 5 deletions
diff --git a/init.lua b/init.lua
index 7863178..1d76d0d 100644
--- a/init.lua
+++ b/init.lua
@@ -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