Open alex-courtis opened 1 year ago
Discrete nvim-tree windows, with their own state that does not affect others.
This could enable us to use NvimTree with edgy.nvim to achieve something like this:
I've been following this issue since it started, and it's been over a year now. It feels like merging all these topics has stalled the discussion, and no progress is being made to address it. This is the feature I look forward to the most, and it's the only reason I still use NERDTree for some projects. I'm eager to move away from that plugin.
Overall, this plugin is fantastic, and it has significantly improved my workflow. I appreciate all the hard work that has gone into making it so great.
I'm willing to help with the development to get this feature implemented. Could you please share what's currently blocking this feature or provide a roadmap? This would help me and others to contribute more effectively.
I'm willing to help with the development to get this feature implemented. Could you please share what's currently blocking this feature or provide a roadmap? This would help me and others to contribute more effectively.
Thanks for bearing with us @raaymax . The only blocker is developer time. Any and all contributions are most gratefully appreciated!
See high level implementation plan above and project board for some refactoring tasks.
Project Board
Any and all contributions are most gratefully appreciated.
Please comment on or assign yourself an issue if would like to work on it OR create a PR (it can be a placeholder) with the issue number e.g. "fixes #9876" in the description.
Current State
nvim-tree allows and supports exactly one window per tab, however there is some shared state between windows.
Problems
- Multiple windows may be opened in one tab via split, however this is not functional
- Windows across tabs are somewhat discrete in that they have their own buffer, however some state is shared e.g. opened folders and bleeds across tabs
Desired Outcome
- Discrete nvim-tree windows, with their own state that does not affect others.
- Single shared nvim-tree windows across tabs, with identical / mirrored state. This is similar to the tree of some IDEs.
Implementation Notes
- Single instance would use the one buffer and state. This would result in the tree being closed across tabs.
- Discrete instances would require the global state to be stored per-instance.
- Global states such as filesystem and git would need to be shared, with single global watchers / background tasks.
Limitations
- This will likely need to be a binary option. Providing a means to manage discrete and shared instances would be (impossibly?) problematic from a UX perspective.
- Floating tree windows are closed when they lose focus, including when swapping tabs. Floating would continue to be restricted to a single ephemeral instance.
Implementation Plan
An incremental approach is more practical, with a feature branch likely interrupting development due to its cross-cutting nature.
- Refactor: move global state / singletons under the explorer.
- Build, experimental feature flag: discrete tree instances for each window.
- Consolidate: callbacks or state updates such as git, watchers, refresh should be applied to each instance.
- Release 2.0.0: following experiment testing, release with the discrete option turned ON by default, as that is closest to current behaviour.
It's not clear yet whether 2 and 3 would be implemented at the same time or sequentially. Simplest/safest implementation can be determined once work begins on 2.
References
- Per Tab nvim-trees #457
- Allow opening the tree just like NERDTree in the current window or new splits when opening directories #1459
- setup switches tabs if nvim tree open in another tab #1491
:NvimTreeToggle
- toggle file explorer in all tabs #1493- tabnew should focus existing tab if file already opened #1687
- Keep tree open in all tabs #1880
- Reuse Buffer #1895
- NvimTree changes root in the other tab after it is reopened #1978
- Opening nvim-tree in a split breaks vinegar-style #2227
- Norton commander-like mode #2252
- Toggling folder expansion in one tab's tree affects the tree in another tab #2257
- how to use tcd instead of lcd/cd to maintain one context per tab #1847
- Is it possible to have separate nvim-tree in each tab with its own root etc? #1960
- How to get nvim-tree to use the same (single) instance in all tabs? #2244
- skip through empty directories #2497
- Retain Tree State on DirChanged #2488
- how to use one instance in different tab #2718
- Can't open a buffer in new tabpage when
quit_on_open
+hijack_unnamed_buffer_when_opening
are true #2851
Project Board
Any and all contributions are most gratefully appreciated.
Please comment on or assign yourself an issue if you're working on it.
Current State
nvim-tree allows and supports exactly one window per tab, however there is some shared state between windows.
Problems
Desired Outcome
Implementation Notes
Limitations
Implementation Plan
An incremental approach is more practical, with a feature branch likely interrupting development due to its cross-cutting nature.
It's not clear yet whether 2 and 3 would be implemented at the same time or sequentially. Simplest/safest implementation can be determined once work begins on 2.
References