Skip to content

Commit

Permalink
fix: version strings with no patch (closes #1540)
Browse files Browse the repository at this point in the history
  • Loading branch information
ibhagwan committed Nov 27, 2024
1 parent 0fb913b commit dcbf999
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/fzf-lua/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1179,9 +1179,9 @@ end

local function version_str_to_num(str)
if type(str) ~= "string" then return end
local major, minor, patch = str:match("(%d+).(%d+).(%d+)")
local major, minor, patch = str:match("(%d+).(%d+)%.?(.*)")
if not major and str:match("HEAD") then return 5 end
return tonumber(string.format("%d.%d%d", major, minor, patch))
return tonumber(string.format("%d.%d%d", major, minor, tonumber(patch) or 0))
end

function M.fzf_version(opts)
Expand Down

0 comments on commit dcbf999

Please sign in to comment.