-
-
Notifications
You must be signed in to change notification settings - Fork 611
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(#2794): sshfs compatibility #2922
Conversation
This reverts commit 8405ecf. Fix for symlinks is simple
We may need to update |
Looks good. Instrumenting shows no mismatch on lstat, mismatch when changed back to stat:
Over sshfs t is always nil (expected) but type is correct. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good; great find on lstat
!
No major changes needed.
We do, however, need to test this:
- I've tested linux local and remote.
- Have you tested macos? I am assuming yes from the bug report.
Windows is always a problem and we do need to check it; moving to lstat
is a larger change that needs to be tested. I don't have access to windows.
I'd be most grateful if you (or a volunteer) tested on windows: WSL and powershell.
lua/nvim-tree/explorer/init.lua
Outdated
@@ -151,11 +154,11 @@ function Explorer:reload(node, git_status) | |||
|
|||
if not nodes_by_path[abs] then | |||
local new_child = nil | |||
if t == "directory" and vim.loop.fs_access(abs, "R") and Watcher.is_fs_event_capable(abs) then | |||
if type == "directory" and vim.loop.fs_access(abs, "R") and Watcher.is_fs_event_capable(abs) then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid any future refactor/rebase fails, and to keep git history simple, please rename type
to t
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be fs_lstat?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessary but we can change for consistency.
lua/nvim-tree/explorer/init.lua
Outdated
table.insert(parent_nodes, node) | ||
end | ||
end) | ||
:iterate() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary whitespace change.
You can make style-fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably a result of using :Format
. I'll use the make style next time.
I am running Linux as well. I don't have access to a Windows/MacOS machine to test. |
I can find someone with macos however I don't know anyone with windows. If we can't test on windows we will need to use |
Whoops, apologies, closed by accident (ctrl-enter...) |
@mxple I do very much wish to merge this. |
@alex-courtis I got a Windows installation up and running. I've tested |
You legend! We now have verified base functionality on all 3.5 OS. I've done similar basic tests on macos. We have tested sshfs compatibility on linux; that's new functionality we can be optimistic about. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many thanks @mxple I really appreciate all your work on this difficult one.
fixes #2794
Re-add sshfs compatibility. Update to use
fs_lstat
instead offs_stat
so symlinks aren't automatically followed.