Skip to content

fix(#3143): actions.open_file.window_picker.exclude applies when not using window picker #3144

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 2 commits into from
Jun 14, 2025

Conversation

LucasMABF
Copy link
Contributor

Description

This PR ensures that when using open.no_window_picker, the fallback window selection respects the window_picker.exclude configuration.
Previously, if no window picker was used, nvim-tree would open the file in the last active window, even if that window matched an excluded type (e.g., a terminal).
Now it sets the fallback window as the first available usable window, not excluded in the configuration, which can prevent undesired behavior.

Related Issue

Fixes #3143

Additional Notes

I removed the first_win_id function to avoid redundant calls to usable_win_ids. Happy to adjust if you'd like to keep it.

Let me know if there’s any other adjustment or further cleanup you’d like.
Appreciate your time and review!

Copy link
Member

@alex-courtis alex-courtis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested OK via open_file.window_picker.exclude variants.

Many thanks for your contribution @LucasMABF !

@alex-courtis alex-courtis changed the title fix(#3143): ensure open.no_window_picker respects window_picker.exclude fix(#3143): actions.open_file.window_picker.exclude applies when not using window picker Jun 14, 2025
@alex-courtis alex-courtis merged commit 05d8172 into nvim-tree:master Jun 14, 2025
4 checks passed
@LucasMABF LucasMABF deleted the fix-no-window-picker-exclude branch June 15, 2025 20:28
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.

open.no_window_picker fallback window should respect window_picker.exclude settings
2 participants