0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 7.4.2043

Problem:    setbuvfar() causes a screen redraw.
Solution:   Only use aucmd_prepbuf() for options.
This commit is contained in:
Bram Moolenaar
2016-07-15 20:14:44 +02:00
parent fdadad994a
commit 93431df9eb
2 changed files with 13 additions and 7 deletions

View File

@@ -18495,7 +18495,6 @@ f_serverlist(typval_T *argvars UNUSED, typval_T *rettv)
f_setbufvar(typval_T *argvars, typval_T *rettv UNUSED) f_setbufvar(typval_T *argvars, typval_T *rettv UNUSED)
{ {
buf_T *buf; buf_T *buf;
aco_save_T aco;
char_u *varname, *bufvarname; char_u *varname, *bufvarname;
typval_T *varp; typval_T *varp;
char_u nbuf[NUMBUFLEN]; char_u nbuf[NUMBUFLEN];
@@ -18509,35 +18508,40 @@ f_setbufvar(typval_T *argvars, typval_T *rettv UNUSED)
if (buf != NULL && varname != NULL && varp != NULL) if (buf != NULL && varname != NULL && varp != NULL)
{ {
/* set curbuf to be our buf, temporarily */
aucmd_prepbuf(&aco, buf);
if (*varname == '&') if (*varname == '&')
{ {
long numval; long numval;
char_u *strval; char_u *strval;
int error = FALSE; int error = FALSE;
aco_save_T aco;
/* set curbuf to be our buf, temporarily */
aucmd_prepbuf(&aco, buf);
++varname; ++varname;
numval = (long)get_tv_number_chk(varp, &error); numval = (long)get_tv_number_chk(varp, &error);
strval = get_tv_string_buf_chk(varp, nbuf); strval = get_tv_string_buf_chk(varp, nbuf);
if (!error && strval != NULL) if (!error && strval != NULL)
set_option_value(varname, numval, strval, OPT_LOCAL); set_option_value(varname, numval, strval, OPT_LOCAL);
/* reset notion of buffer */
aucmd_restbuf(&aco);
} }
else else
{ {
buf_T *save_curbuf = curbuf;
bufvarname = alloc((unsigned)STRLEN(varname) + 3); bufvarname = alloc((unsigned)STRLEN(varname) + 3);
if (bufvarname != NULL) if (bufvarname != NULL)
{ {
curbuf = buf;
STRCPY(bufvarname, "b:"); STRCPY(bufvarname, "b:");
STRCPY(bufvarname + 2, varname); STRCPY(bufvarname + 2, varname);
set_var(bufvarname, varp, TRUE); set_var(bufvarname, varp, TRUE);
vim_free(bufvarname); vim_free(bufvarname);
curbuf = save_curbuf;
} }
} }
/* reset notion of buffer */
aucmd_restbuf(&aco);
} }
} }

View File

@@ -758,6 +758,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
2043,
/**/ /**/
2042, 2042,
/**/ /**/