diff options
| author | jdhao <jdhao@hotmail.com> | 2022-08-14 22:54:19 +0800 |
|---|---|---|
| committer | jdhao <jdhao@hotmail.com> | 2022-08-14 22:54:19 +0800 |
| commit | a52a362b028d83a349a311e80bb4c29fe06b0849 (patch) | |
| tree | 160253aec74323baa68c4525a4b2ef76a808490f /lua | |
| parent | 2880d7bce353e5e96e8f3f44e38982bf80ba6d69 (diff) | |
update version check
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/utils.lua | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/lua/utils.lua b/lua/utils.lua index fa025f1..ae9e0e9 100644 --- a/lua/utils.lua +++ b/lua/utils.lua @@ -25,23 +25,11 @@ function M.may_create_dir() end end -function M.check_version_match() - -- check if we have the lastest stable version of nvim - local expected_ver = {major = 0, minor = 7, patch = 2} +function M.get_nvim_version() local actual_ver = vim.version() - local ver_match = true - for key, val in pairs(expected_ver) do - if val ~= actual_ver[key] then - ver_match = false - break - end - end - - local expect_ver_str = string.format("%s.%s.%s", expected_ver.major, expected_ver.minor, expected_ver.patch) - local nvim_ver_str = string.format("%s.%s.%s", actual_ver.major, actual_ver.minor, actual_ver.patch) - - return {match=ver_match, expected=expect_ver_str, actual=nvim_ver_str} + local nvim_ver_str = string.format("%d.%d.%d", actual_ver.major, actual_ver.minor, actual_ver.patch) + return nvim_ver_str end return M |
