Skip to content

Set target window whenever we open "open" a visible tree #1080

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

Merged
merged 1 commit into from
Mar 18, 2022

Conversation

maxyz
Copy link
Contributor

@maxyz maxyz commented Mar 16, 2022

Currently the target window to be used (with a disabled pick window) is the one that was "focused" when the tree was first opened.
So, if you let the tree open, the splits and open file are going to target the original window.
This is counter intuitive and annoying if what you want to achieve is to open a file in a split.
This minor change updates the target window whenever we try to open the tree, that's executed whenever we focus the tree, so the behavior is now that the splits and open_file are executed against the previously focused buffer.

Currently the target window to be used (with a disabled pick window) is the one that was "focused" when the tree was first opened.
So, if you let the tree open, the splits and open file are going to target the original window.
This is counter intuitive and annoying if what you want to achieve is to open a file in a split.
This minor change updates the target window whenever we try to open the tree, that's executed whenever we focus the tree, so the behaviour is now that the splits and open_file are executed against the previously focussed buffer.
@kyazdani42 kyazdani42 merged commit d60773e into nvim-tree:master Mar 18, 2022
Almo7aya pushed a commit to Almo7aya/nvim-tree.lua that referenced this pull request Oct 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants