-
-
Notifications
You must be signed in to change notification settings - Fork 619
'vsplit' action doesn't respect 'set splitright' if assigned an open window picker #2089
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
Comments
Unfortunately I cannot replicate this. nvim / nvim-tree defaults: actual
Please provide a Clean Room Replication as per the bug report instructions. It is likely that there are other plugins and automation interfering. |
Sorry, autocmd BufEnter NvimTree_* set nosplitright This setting is used during test and resolve this issue, but I forget to clean it. After clean this autocmd, my solution(customize
Thanks a lot for the quick response. |
FYI @cjun714 Now might be good to follow the (automated) Migrating To on_attach |
Thanks for remind, Thank you! |
Thanks for the feedback. |
Description
Hi, thanks a lot for creating this amazing plugin,
I am new for nvim-tree, I used defx before, I try to config this plugin like defx, but there is an issue I can't handle,
please help, thanks!
Here is my requirement:
I often use this layout by using defx:
When I use 'open' action on defx-tree, the file will be opened in 'left window', which is my main work area.
I use left window for coding, and use right window for reference doc.
So if I want to refer a doc or code, I use 'vsplit' action on defx-tree to open that doc in a new right split window,
the layout will change into this:
If I keep use 'open' action on defx-tree, the file will always be opened in the same 'left window'.
If I use another 'vsplit' action on defx-tree, the file will be opened in a new right split window, like this:
So, the key point is 'open' action always reuse left window,
'vsplit' action always create new split window on the right side.
Since defx 'open' action always open file in left window, and below setting will let 'vsplit' to create split window on right side by using
drop
parameter:I have read nvim-tree's doc, the 'open' strategy is controlled by window picker,
if picker is disabled, plugin will open file in the last window which invoke the tree.
The picker can be a function, so I create a picker
This made 'open' action can always open file in left split window without considering the last window invoked tree,
but the problem is that 'vsplit' action also open file in left split window,
and I 'set splitright' also doesn't work, the 'vsplit' action doesn't respect this option.
I am not sure it's a bug or feature.
My expectation is the
open window picker
should change the file open strategy, but should not change 'vsplit' strategy,'vsplit' should respect 'set splitright' option, that can help make separate strategies for 'open' and 'vsplit',
'open' should open file on left and 'vsplit' should on right, at least that's make sense to me
I find 2 issues below that correlated with this issue, but I cant find a solution.
' vsplit always opens to the left, can it be on the right?' #1626 and 'pick window when vsplit open file not work!' #1233
Is it possiable to always 'open'(open.edit) file in left window and vsplit(open.edit) in new right split window?
I don't know how to solve this, could you please help, thanks!
Neovim version
Operating system and version
Ubuntu 22.04
nvim-tree version
latest
Minimal config
Steps to reproduce
open nvim-tree
:NvimTreeToggle
trigger 'edit' action
press 'l' on tree node
trigger 'vsplit' action
press 'v' on another tree node
Expected behavior
3.'vsplit' action :
Actual behavior
3.'vsplit' action :
The text was updated successfully, but these errors were encountered: