Skip to content

Commit fd9dee0

Browse files
AbaoFromCUGpysan3
authored andcommitted
fix(base): Path.glob return nil when finished
1 parent d4522df commit fd9dee0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lua/pathlib/base.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,9 @@ function Path:glob(pattern)
629629
local result, i = vim.fn.globpath(str, pattern, false, true), 0 ---@diagnostic disable-line
630630
return function()
631631
i = i + 1
632-
return self.new(result[i])
632+
if i <= #result then
633+
return self.new(result[i])
634+
end
633635
end
634636
end
635637

0 commit comments

Comments
 (0)