Comments (14)
Ah I actually didn't really mean more than one workspace tbh, although if you mean like vscode that might be cool. I basically just meant when you open Lua Tree in a buffer the root directory should be the one of the current buffer. I tried master but it didn't resolve it unfortunately. I made a PR #13 which works for me locally. Let me know what you think 👍
from nvim-tree.lua.
If you point me in the right direction I can take a look if that would help? Might take me a bit to figure out how it works first
from nvim-tree.lua.
Thanks for making so detailed issues :)
Well i can take a look, the code is a little bit nasty imo so it might be easier for me to fix this !
from nvim-tree.lua.
i hate lua regex matching.
If it's not fixed on your end, reopen this
from nvim-tree.lua.
Thanks for the quick PR @kyazdani42 just tested it locally and seems to still be happening
from nvim-tree.lua.
mmh strange i cannot reproduce the issue anymore.
Well if you want to take a look at the find_file
function in lua/lib/state.lua
, your issue should be located around
if node.relpath and relpath:find(utils.path_to_matching_str(node.relpath)) then
where relpath is the relative path of the node, and path_to_matching_str a function replacing -
and .
characters with %-
and %.
for lua to match paths properly in string:find.
The function itself is a bit clunky, but the only part that failed me a few times is this if condition.
from nvim-tree.lua.
Are you running macos or linux ?
from nvim-tree.lua.
Are you running macos or linux ?
I'm on Ubuntu 20.04
It looks like lua tree uses the dir that vim was opened from and sticks with that regardless of what buffer you are in, not sure if that is the intended behaviour?
My assumption was that if I opened vim in say ~/myproject/
it would change the lua tree dir depending on the buffer I was editing. In my case I navigated to ~/.dotfiles/vim/init.vim
so I expected the root dir would change to either be ~/.dotfiles
since it is a repo but granted doing project dirs is maybe an extra feature, then maybe the root dir would be ~/.dotfiles/vim
but the lua tree stays in ~/myproject/
.
from nvim-tree.lua.
Alternatively maybe lua tree should just follow vim's dir and then users can use settings like autochdir
or plugins like vim-rooter
🤷
from nvim-tree.lua.
So it is a different kind of issue, indeed this plugin uses the default dir where it was opened.
I stick with that because sometimes i'm in a project, and i want to open the tree in a subdirectory (and i dont want the tree to go to the root of the project).
I could add an option for that though, should be simple to fix.
Also multiple projects is a feature i didn't think about, but it would be quite hard to implement in the current state, it would require a different implementation.
I was thinking of doing a big refactoring soon, to make the code better and the plugin more stable, and i'd also like to use vim nightly features (because its much more convenient).
I might add the feature to the refactoring if i find a proper way to implement it.
from nvim-tree.lua.
One way that I've seen this solved is in defx
you can pass an argument to the launch command like LuaTree --path=("user_finds_path")
maybe that's a cheaper way to solve the problem or maybe it's just as complex, not sure
from nvim-tree.lua.
well i prefer classic g:
options, its easier to manage in my opinion
from nvim-tree.lua.
oh my bad i just realized i didn't understand your issue at all. I'm gonna fix this asap sorry !
from nvim-tree.lua.
it's fixed, i will add support for multiple workspaces one day, thanks for the tip ;)
from nvim-tree.lua.
Related Issues (20)
- An option to control weather change root_folder when root_folder be clicked. HOT 1
- If using floating mode and creating a new file the floating window becomes the created file. HOT 2
- Bookmark filter should include parent directory HOT 1
- Bad contrast for NvimTreeWindowPicker & NvimTreeBookmarkHL on default colorscheme HOT 7
- Mappings/functionality discoverability discussion HOT 10
- update_root won't update with respect_buf_cwd when open file HOT 3
- change_root_to_node() does not work on files HOT 1
- how to use one instance in different tab HOT 2
- Sticky nvim-tree and not using window_picker: How to remember the window where navigating into nvim-tree from?
- Quitting neovim takes a long time when toggling git ignore folders HOT 3
- Add winfixbuf to view options HOT 4
- Provide interface to customize the comparing function between two nodes HOT 1
- 0.10 luadoc and lsp integration
- Parent folder deleted when deleting a folder starting with $ HOT 4
- Make it easy to discover useful shortcuts HOT 2
- New File getting opened in floating window. HOT 5
- Module `nvim-tree.renderer.help` not found when install nvim-tree through Lazy HOT 1
- nvim-tree not respecting diagnostics update_in_insert value set by neovim HOT 8
- Float window for full filenames has wrong bg HOT 2
- Floating nvim-tree does not respect config on startup HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nvim-tree.lua.