diff --git a/neovim/lua/plugins.lua b/neovim/lua/plugins.lua index e57c206..960b5d1 100644 --- a/neovim/lua/plugins.lua +++ b/neovim/lua/plugins.lua @@ -208,7 +208,7 @@ use("folke/trouble.nvim") use({ "jose-elias-alvarez/null-ls.nvim", commit = utils.map_version_rule({ - [">=0.6.0"] = nil, + [">=0.6.0"] = utils.nil_val, [">=0.5.1"] = "739a98c12bedaa2430c4a3c08d1d22ad6c16513e", [">=0.5.0"] = "3e7390735501d0507bf2c2b5c2e7a16f58deeb81", }), @@ -297,7 +297,7 @@ use({ "nvim-telescope/telescope-file-browser.nvim", }, tag = utils.map_version_rule({ - [">=0.6.0"] = nil, + [">=0.6.0"] = utils.nil_val, ["<0.6.0"] = "nvim-0.5.1", ["==0.5.0"] = "nvim-0.5.0", }), diff --git a/neovim/lua/utils.lua b/neovim/lua/utils.lua index dc3d250..6b39d47 100644 --- a/neovim/lua/utils.lua +++ b/neovim/lua/utils.lua @@ -153,6 +153,8 @@ function M.materialize_list(list, iterator) return list end +M.nil_val = {} + -- Maps a set of version rules to a value eg. [">0.5.0"] = "has 0.5.0" -- If more than one rule matches, the one with the greatest version number is used function M.map_version_rule(rules) @@ -197,6 +199,10 @@ function M.map_version_rule(rules) end -- Return highest versioned matched value + if latest_value == M.nil_val then + return nil + end + return latest_value end