* Revert "revert(#2794): sshfs compatibility (#2920)"
This reverts commit 8405ecfbd6.
Fix for symlinks is simple
* fix sshfs compatibility with symlinks
* add suggestions
* revert variable name change to ease multi-instance feature branch conflicts
---------
Co-authored-by: Alexander Courtis <alex@courtis.org>
This commit is contained in:
@@ -57,13 +57,18 @@ local function remove_dir(cwd)
|
||||
end
|
||||
|
||||
while true do
|
||||
local name, t = vim.loop.fs_scandir_next(handle)
|
||||
local name, _ = vim.loop.fs_scandir_next(handle)
|
||||
if not name then
|
||||
break
|
||||
end
|
||||
|
||||
local new_cwd = utils.path_join { cwd, name }
|
||||
if t == "directory" then
|
||||
|
||||
-- Type must come from fs_stat and not fs_scandir_next to maintain sshfs compatibility
|
||||
local stat = vim.loop.fs_stat(new_cwd)
|
||||
local type = stat and stat.type or nil
|
||||
|
||||
if type == "directory" then
|
||||
local success = remove_dir(new_cwd)
|
||||
if not success then
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user