Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: handle vim.version.parse returning nil #34

Merged
merged 1 commit into from
Aug 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions lua/rocks_treesitter/highlight.lua
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,10 @@ local function prompt_auto_install(rocks)
function(latest_version, rock)
---@type boolean, vim.Version?
local ok, version = pcall(vim.version.parse, rock.version)
if
ok
and latest_version
and version --[[ @as vim.Version ]]
> latest_version
then
return version
elseif ok then
return version
if latest_version then
return (ok and version and version > latest_version and version) or latest_version
else
return ok and version
end
end
)
Expand Down
Loading