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 = 0Which 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_relativelyto 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