fix: opening multiple current neo-tree windows #590
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When opening a new neo-tree window with the
currentposition, do not close all othercurrentwindows.This allows having multiple
currentwindows side-by-side on the same tabpage.It was possible before with the following combination (open neo-tree in one buffer, then split it):
This opened two neo-tree windows side-by-side (when
hijack_netrw_behaviorwas set toopen_current).Peek.2022-11-05.10-53.netrw.side.by.side.working.well.mp4
However, when trying to it the other way around (open two buffers side by side, open neo-tree in one of them, then switch to the other buffer and open neo-tree in that one):
Opening the second neo-tree window closed the first one.
Peek.2022-11-05.10-54.neotree.open.current.closes.the.other.one.mp4
With this fix, both combinations lead to the same result of having two independent neo-tree windows side-by-side with the
currentposition.Peek.2022-11-05.10-54.neotree.open.current.works.fine.with.fix.mp4
My neo-tree config in case that is relevant: https://github.com/Gelio/ubuntu-dotfiles/blob/4cb7abb39849f75b51a504fd120e1d2511071cb8/install/neovim/stowed/.config/nvim/lua/plugins.lua#L91-L156