From 644993a89e8be251c10f4d2b1bb761301f4545b1 Mon Sep 17 00:00:00 2001 From: jdhao Date: Fri, 7 Apr 2023 22:42:24 +0200 Subject: bump to nvim version 0.9.0 (#188) --- init.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'init.lua') 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 -- cgit v1.2.3