diff options
| author | Rob Pilling <robpilling@gmail.com> | 2026-08-02 19:37:26 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-08-02 14:37:26 -0400 |
| commit | 2f09090134455a75d09621821ab31f87f2c9c908 (patch) | |
| tree | 0541e3df2a9f3a9036ce9b4b70cda03b14bb5d14 /runtime/ftplugin/java.vim | |
| parent | ecae8c994e136733239c542720535d3921cfc780 (diff) | |
| download | rneovim-2f09090134455a75d09621821ab31f87f2c9c908.tar.gz rneovim-2f09090134455a75d09621821ab31f87f2c9c908.tar.bz2 rneovim-2f09090134455a75d09621821ab31f87f2c9c908.zip | |
fix(ui2): `:$q` should not target hidden windows #40992
Similar to #36123, the ui2 windows confuse `:$q`, which doesn't close
the last window on the tab, but targets a hidden ui2 window.
The problem seems to be a combination of using
`FOR_ALL_WINDOWS_IN_TAB()`, which includes hidden windows, and then
counting the windows without factoring in `win_has_winnr()`.
There are examples of using `win_has_winnr()`, such as:
- [`eval/buffer.c`'s `buf_win_common()`](https://github.com/neovim/neovim/blob/4a5062cda69fa6cb59b7dc0c488dfb05accf99de/src/nvim/eval/buffer.c#L474-L475)
- [`eval/window.c`'s `f_getwininfo()`](https://github.com/neovim/neovim/blob/4a5062cda69fa6cb59b7dc0c488dfb05accf99de/src/nvim/eval/window.c#L130-L135)
- [`window.c`'s `win_get_tabwin()`](https://github.com/neovim/neovim/blob/4a5062cda69fa6cb59b7dc0c488dfb05accf99de/src/nvim/window.c#L7860-L7869)
But possibly problematic ones:
- `ex_docmd.c`'s:
- [`invalid_range()`](https://github.com/neovim/neovim/blob/4a5062cda69fa6cb59b7dc0c488dfb05accf99de/src/nvim/ex_docmd.c#L3891-L3893)
- ^ should this include hidden windows? Can a user address them by number? `win_has_winnr()` suggests not
- [`ex_close()`](https://github.com/neovim/neovim/blob/4a5062cda69fa6cb59b7dc0c488dfb05accf99de/src/nvim/ex_docmd.c#L5233-L5244)
- [`ex_hide()`](https://github.com/neovim/neovim/blob/4a5062cda69fa6cb59b7dc0c488dfb05accf99de/src/nvim/ex_docmd.c#L5478-L5484)
- `eval/window.c`'s:
- [`f_winrestcmd()`](https://github.com/neovim/neovim/blob/4a5062cda69fa6cb59b7dc0c488dfb05accf99de/src/nvim/eval/window.c#L797-L808)
- [`find_win_by_nr()`](https://github.com/neovim/neovim/blob/4a5062cda69fa6cb59b7dc0c488dfb05accf99de/src/nvim/eval/window.c#L172-L180)
Diffstat (limited to 'runtime/ftplugin/java.vim')
0 files changed, 0 insertions, 0 deletions