Skip to content

open.no_window_picker fallback window should respect window_picker.exclude settings #3143

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

Closed
LucasMABF opened this issue Jun 13, 2025 · 1 comment · Fixed by #3144
Closed
Labels
bug Something isn't working regression Existing functionality broken reproduced Issue confirmed

Comments

@LucasMABF
Copy link
Contributor

LucasMABF commented Jun 13, 2025

Description

When opening a file without the window picker, nvim-tree opens a buffer in the last active window, without considering the window_picker.exclude configuration. For instance, opening the tree while inside a terminal buffer will cause the next opened file to replace the terminal (given that it opens with open.no_window_picker).

I'm not sure if this is actually a bug or intended behavior. However, I was able to fix it with a small change in open-file.lua. I'll link a PR to this issue in case you find this change desirable.

nvim-tree version

master branch — commit 1c733e8

Clean room replication

Default nvt-min.lua minimal configuration

Steps to reproduce

  1. Open a terminal and a file in a split
  2. Focus the terminal window
  3. Open tree
  4. Open a file with "no picker" mode (O in default mapping)

Expected behavior

Nvim-tree should open the file in a window considering the window_picker.exclude configuration.

Actual behavior

Nvim-tree opens the file in the last active window, disregarding any configuration and buffer type.


Thanks for your time

LucasMABF added a commit to LucasMABF/nvim-tree.lua that referenced this issue Jun 13, 2025
@alex-courtis alex-courtis added bug Something isn't working regression Existing functionality broken reproduced Issue confirmed labels Jun 14, 2025
@alex-courtis
Copy link
Member

This could be considered a break in functionality, however it's sensible and users can control this behaviour via exclude.

alex-courtis added a commit to LucasMABF/nvim-tree.lua that referenced this issue Jun 14, 2025
alex-courtis added a commit that referenced this issue Jun 14, 2025
…using window picker (#3144)

* fix(#3143): ensure open.no_window_picker respects window_picker.exclude

* fix(#3143): doc

---------

Co-authored-by: Alexander Courtis <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working regression Existing functionality broken reproduced Issue confirmed
Projects
None yet
2 participants