nvim-tree.lua
nvim-tree.lua copied to clipboard
fix(#1480): break symlink cycle on find-file, search-node
closes #1480
- detect cycles on search-node
S
- search link paths, not target paths on find-file
expand-all is OK as it stops after max_folder_discovery
, however it does follow cycles. We should look at that if time permits.
@archiif your testing would be gratefully appreciated.
does this change means that nvim-tree will not find file in symlink directories ? I think we should only prevent looping indefinitely right ?
I recall that it did. I'll re-test on the weekend.
Thanks a lot for this PR! I did a quick test and it fixed my issue.
nvim-tree doesn't seem to track the current directory, so when you C-]
into a symlinked directory and go back up again, you end up in the new target directory. So I'm not sure how to test what @kyazdani42 is saying.
nvim-tree doesn't seem to track the current directory, so when you
C-]
into a symlinked directory and go back up again, you end up in the new target directory.
~~That's working as intended: nvim-tree simply finds the file, and find always picks the real directory. That could be changed in the future, but would need some thought.~~
C-]
changes to the realpath of the directory. That could be changed in the future, but would need some thought.
Still testing...
does this change means that nvim-tree will not find file in symlink directories ? I think we should only prevent looping indefinitely right ?
It is not finding files in symlink directories outside cwd. Reworked as a simple cycle detector as per search-node.