-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add user choice to follow symlinks or keep them #1404
Comments
Hi, Thanks for bringing this up. The reason behind resolving the symlinks in NERDTree was to show the symlink destination in the tree with the Until now there was no good reason for using #1367, But if we use it to keep symlinks unresolved it can be useful. |
I think showing the symlinks (and junctions on Windows) is fine, as it will not cause problems to users, But replacing the symlink with the target, when changing directory (or loading a directory) or opening a file, is a different option. I noticed somehow my simple patch obove does not affect how symlinks are displayed, but still prevents changing the original directory. So luckily it did exactly what I wanted. |
Maybe I'm wrong since I didn't use the patch I just read it, As far as I've seen NERDTree needs to resolve the path to knowing if a file is a symlink or not so I don't know how bypassing it wouldn't break the symlink destination. |
Add new option so users can choose to resolve symlinks or not.
Automatically resolving symlinks is not always the right choice, and is different from what Vim does, and can cause some issues for users when their directory changes unexpectedly.
Attached a (rather naive) patch that simply skips the call to Vim resolve() function if the option
g:NERDTreeResolveSymLinks
is disabled (v:false
). The default option isv:true
, to keep the original behavior of NERDTree, though I do not recommend it.symlinks.zip
The text was updated successfully, but these errors were encountered: