Created
December 10, 2024 08:33
-
-
Save delphinus/16c6b54fae84b20d2c9590dd19115d37 to your computer and use it in GitHub Desktop.
Check semver in lazy.nvim
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vim.api.nvim_create_user_command("LazySemver", function(opts) | |
if #opts.fargs ~= 2 then | |
vim.notify("needs 2 args: spec and version", vim.log.levels.ERROR) | |
return | |
end | |
local sv = require("lazy.manage.semver") | |
local matched = sv.range(opts.fargs[1]):matches(opts.fargs[2]) | |
vim.notify(matched and "OK" or "NG", vim.log.levels[matched and "info" or "WARN"]) | |
end, { nargs = "*" }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment