From 7abec5e5943fbbe7b0bb79ff2246eb58b57654fe Mon Sep 17 00:00:00 2001 From: kiyan Date: Wed, 30 Jun 2021 22:29:11 +0200 Subject: [PATCH] fix(sshfs): use stat to get the filetype when fs_scandir does not return the type --- lua/nvim-tree/populate.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lua/nvim-tree/populate.lua b/lua/nvim-tree/populate.lua index a4ddcc7a..a2a000e3 100644 --- a/lua/nvim-tree/populate.lua +++ b/lua/nvim-tree/populate.lua @@ -290,7 +290,13 @@ function M.populate(entries, cwd, parent_node) local name, t = luv.fs_scandir_next(handle) if not name then break end - if not should_ignore(utils.path_join({cwd, name})) then + local abs = utils.path_join({cwd, name}) + if not should_ignore(abs) then + if not t then + local stat = luv.fs_stat(abs) + t = stat and stat.type + end + if t == 'directory' then table.insert(dirs, name) elseif t == 'file' then