fix(float): skip non-focusable windows for :windo (#15378)

This commit is contained in:
Daniel Steinberg
2021-11-11 13:05:18 -05:00
committed by GitHub
parent 9d6a475ced
commit e8631cb8a6
2 changed files with 135 additions and 7 deletions

View File

@@ -1381,6 +1381,7 @@ void ex_listdo(exarg_T *eap)
listcmd_busy = true; // avoids setting pcmark below
while (!got_int && buf != NULL) {
bool execute = true;
if (eap->cmdidx == CMD_argdo) {
// go to argument "i"
if (i == ARGCOUNT) {
@@ -1406,11 +1407,14 @@ void ex_listdo(exarg_T *eap)
break;
}
assert(wp);
win_goto(wp);
if (curwin != wp) {
break; // something must be wrong
execute = !wp->w_floating || wp->w_float_config.focusable;
if (execute) {
win_goto(wp);
if (curwin != wp) {
break; // something must be wrong
}
}
wp = curwin->w_next;
wp = wp->w_next;
} else if (eap->cmdidx == CMD_tabdo) {
// go to window "tp"
if (!valid_tabpage(tp)) {
@@ -1433,8 +1437,10 @@ void ex_listdo(exarg_T *eap)
i++;
// execute the command
do_cmdline(eap->arg, eap->getline, eap->cookie,
DOCMD_VERBOSE + DOCMD_NOWAIT);
if (execute) {
do_cmdline(eap->arg, eap->getline, eap->cookie,
DOCMD_VERBOSE + DOCMD_NOWAIT);
}
if (eap->cmdidx == CMD_bufdo) {
// Done?
@@ -1485,7 +1491,7 @@ void ex_listdo(exarg_T *eap)
}
}
if (eap->cmdidx == CMD_windo) {
if (eap->cmdidx == CMD_windo && execute) {
validate_cursor(); // cursor may have moved
// required when 'scrollbind' has been set
if (curwin->w_p_scb) {