Skip to content

Commit

Permalink
fix(base): Path.glob return nil when finished
Browse files Browse the repository at this point in the history
  • Loading branch information
AbaoFromCUG authored and pysan3 committed Apr 26, 2024
1 parent d4522df commit fd9dee0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lua/pathlib/base.lua
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,9 @@ function Path:glob(pattern)
local result, i = vim.fn.globpath(str, pattern, false, true), 0 ---@diagnostic disable-line
return function()
i = i + 1
return self.new(result[i])
if i <= #result then
return self.new(result[i])
end
end
end

Expand Down

0 comments on commit fd9dee0

Please sign in to comment.