fix(util): assume type is file when no type is returned by scandir. Fixes #306

This commit is contained in:
Folke Lemaitre 2023-01-04 08:57:50 +01:00
parent e61b334cee
commit 2e87520826
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
1 changed files with 3 additions and 0 deletions

View File

@ -171,6 +171,9 @@ function M.ls(path, fn)
local handle = vim.loop.fs_scandir(path)
while handle do
local name, t = vim.loop.fs_scandir_next(handle)
-- HACK: assume type is a file if no type returned
-- see https://github.com/folke/lazy.nvim/issues/306
t = t or "file"
if not name then
break
end