summaryrefslogtreecommitdiffstats
path: root/src/channel.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/channel.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/channel.c')
-rw-r--r--src/channel.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/channel.c b/src/channel.c
index 08b1ac8670..4e6457546a 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -2872,8 +2872,14 @@ append_to_buffer(buf_T *buffer, char_u *msg, channel_T *channel, ch_part_T part)
buffer->b_p_ma = TRUE;
- // set curbuf to be our buf, temporarily
+ // Set curbuf to "buffer", temporarily.
aucmd_prepbuf(&aco, buffer);
+ if (curbuf != buffer)
+ {
+ // Could not find a window for this buffer, the following might cause
+ // trouble, better bail out.
+ return;
+ }
u_sync(TRUE);
// ignore undo failure, undo is not very useful here