summaryrefslogtreecommitdiffstats
path: root/src/evalvars.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/evalvars.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/evalvars.c')
-rw-r--r--src/evalvars.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/evalvars.c b/src/evalvars.c
index 28516c172b..20223c8fe8 100644
--- a/src/evalvars.c
+++ b/src/evalvars.c
@@ -4761,13 +4761,16 @@ f_setbufvar(typval_T *argvars, typval_T *rettv UNUSED)
{
aco_save_T aco;
- // set curbuf to be our buf, temporarily
+ // Set curbuf to be our buf, temporarily.
aucmd_prepbuf(&aco, buf);
+ if (curbuf == buf)
+ {
+ // Only when it worked to set "curbuf".
+ set_option_from_tv(varname + 1, varp);
- set_option_from_tv(varname + 1, varp);
-
- // reset notion of buffer
- aucmd_restbuf(&aco);
+ // reset notion of buffer
+ aucmd_restbuf(&aco);
+ }
}
else
{