summaryrefslogtreecommitdiffstats
path: root/src/diff.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/diff.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/diff.c')
-rw-r--r--src/diff.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/diff.c b/src/diff.c
index 80f1eb3368..88e3ec4533 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -2786,8 +2786,12 @@ ex_diffgetput(exarg_T *eap)
idx_to = idx_other;
// Need to make the other buffer the current buffer to be able to make
// changes in it.
- // set curwin/curbuf to buf and save a few things
+ // Set curwin/curbuf to buf and save a few things.
aucmd_prepbuf(&aco, curtab->tp_diffbuf[idx_other]);
+ if (curbuf != curtab->tp_diffbuf[idx_other])
+ // Could not find a window for this buffer, the rest is likely to
+ // fail.
+ goto theend;
}
// May give the warning for a changed buffer here, which can trigger the