summaryrefslogtreecommitdiffstats
path: root/src/os_win32.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-11-28 18:51:43 +0000
committerBram Moolenaar <Bram@vim.org>2022-11-28 18:51:43 +0000
commite76062c078debed0df818f70e4db14ad7a7cb53a (patch)
treee43b3b076fdea909c460219e896237a8924ccb6b /src/os_win32.c
parent74a694dbe20bb7dea4e06f474cf62e20f9c92f1d (diff)
patch 9.0.0965: using one window for executing autocommands is insufficientv9.0.0965
Problem: Using one window for executing autocommands is insufficient. Solution: Use up to five windows for executing autocommands.
Diffstat (limited to 'src/os_win32.c')
-rw-r--r--src/os_win32.c33
1 files changed, 18 insertions, 15 deletions
diff --git a/src/os_win32.c b/src/os_win32.c
index 4c97b31002..acbc4cb7d0 100644
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -4878,27 +4878,30 @@ mch_call_shell_terminal(
// Find a window to make "buf" curbuf.
aucmd_prepbuf(&aco, buf);
-
- clear_oparg(&oa);
- while (term_use_loop())
+ if (curbuf == buf)
{
- if (oa.op_type == OP_NOP && oa.regname == NUL && !VIsual_active)
+ // Only do this when a window was found for "buf".
+ clear_oparg(&oa);
+ while (term_use_loop())
{
- // If terminal_loop() returns OK we got a key that is handled
- // in Normal model. We don't do redrawing anyway.
- if (terminal_loop(TRUE) == OK)
+ if (oa.op_type == OP_NOP && oa.regname == NUL && !VIsual_active)
+ {
+ // If terminal_loop() returns OK we got a key that is handled
+ // in Normal model. We don't do redrawing anyway.
+ if (terminal_loop(TRUE) == OK)
+ normal_cmd(&oa, TRUE);
+ }
+ else
normal_cmd(&oa, TRUE);
}
- else
- normal_cmd(&oa, TRUE);
- }
- retval = job->jv_exitval;
- ch_log(NULL, "system command finished");
+ retval = job->jv_exitval;
+ ch_log(NULL, "system command finished");
- job_unref(job);
+ job_unref(job);
- // restore curwin/curbuf and a few other things
- aucmd_restbuf(&aco);
+ // restore curwin/curbuf and a few other things
+ aucmd_restbuf(&aco);
+ }
wait_return(TRUE);
do_buffer(DOBUF_WIPE, DOBUF_FIRST, FORWARD, buf->b_fnum, TRUE);