feat(ui): don't show unfocusable windows in :tabs, 'tabline' #27984

Problem:  Floating windows with focusable set to false can reasonably be
          expected to be UI elements but are listed in some outputs that
          should contain only regular windows.
Solution: Hide unfocusable floating windows from the default tabline and
          :tabs.
This commit is contained in:
luukvbaal
2024-11-17 00:32:36 +01:00
committed by GitHub
parent 29ded88957
commit f85bc41c80
7 changed files with 49 additions and 5 deletions

View File

@@ -130,7 +130,7 @@
/// - focusable: Enable focus by user actions (wincmds, mouse events).
/// Defaults to true. Non-focusable windows can be entered by
/// |nvim_set_current_win()|, or, when the `mouse` field is set to true,
/// by mouse events.
/// by mouse events. See |focusable|.
/// - mouse: Specify how this window interacts with mouse events.
/// Defaults to `focusable` value.
/// - If false, mouse events pass through this window.

View File

@@ -5507,6 +5507,8 @@ static void ex_tabs(exarg_T *eap)
FOR_ALL_WINDOWS_IN_TAB(wp, tp) {
if (got_int) {
break;
} else if (!wp->w_config.focusable) {
continue;
}
msg_putchar('\n');

View File

@@ -760,7 +760,9 @@ void draw_tabline(void)
bool modified = false;
for (wincount = 0; wp != NULL; wp = wp->w_next, wincount++) {
if (bufIsChanged(wp->w_buffer)) {
if (!wp->w_config.focusable) {
wincount--;
} else if (bufIsChanged(wp->w_buffer)) {
modified = true;
}
}