-
-
Notifications
You must be signed in to change notification settings - Fork 629
Use relative path when possible #486
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
Use relative path when possible #486
Conversation
If `vim_tree_load_git_file_relatively~= nil` and inside of a Git folder then work out how to load the file via relative path instead of absolute. Otherwise if either condition is nil then fallback to old behavior of absolute path loading.
please don't assume we're always within a git project, I use nvim to edit non-git-managed files too |
Fixed. :) |
This won't work when the git root is not the cwd of the tree. Also, this will be enabled even when: let g:nvim_tree_load_git_file_relatively = 0 Which goes against how we treat all the other boolean options. #487 is a better approach. |
Gotcha. Since you believe #487 is the better approach I've went and closed this out. |
For some reason this change was reverted: And nvim-tree is once again opening all files using an absolute path, which is a huge pain for me. Why was the change reverted? Is there something we can do to re-introduce it? EDIT: Right, seems like it caused this bug: #495 Anything that can be done to fix it? |
Same issue. Btw, Telescope opens files with relative paths. |
There is little consistency between plugins and whether they open files relatively or absolutely. It should be possible to open relatively; please raise a feature request. |
Introduces a new variable:
vim_tree_load_git_file_relatively
to not impact previous behavior. If non-nil then will attempt to use the absolute path, assuming within a Git project. I couldn't find a way to do it otherwise and didn't want to spend too much time hacking this about.Resolves #482