To: vim_dev@googlegroups.com Subject: Patch 7.4.2043 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 7.4.2043 Problem: setbufvar() causes a screen redraw. Solution: Only use aucmd_prepbuf() for options. Files: src/eval.c *** ../vim-7.4.2042/src/eval.c 2016-07-11 23:15:21.382070070 +0200 --- src/eval.c 2016-07-15 19:11:43.436745438 +0200 *************** *** 18495,18501 **** f_setbufvar(typval_T *argvars, typval_T *rettv UNUSED) { buf_T *buf; - aco_save_T aco; char_u *varname, *bufvarname; typval_T *varp; char_u nbuf[NUMBUFLEN]; --- 18495,18500 ---- *************** *** 18509,18543 **** if (buf != NULL && varname != NULL && varp != NULL) { - /* set curbuf to be our buf, temporarily */ - aucmd_prepbuf(&aco, buf); - if (*varname == '&') { long numval; char_u *strval; int error = FALSE; ++varname; numval = (long)get_tv_number_chk(varp, &error); strval = get_tv_string_buf_chk(varp, nbuf); if (!error && strval != NULL) set_option_value(varname, numval, strval, OPT_LOCAL); } else { bufvarname = alloc((unsigned)STRLEN(varname) + 3); if (bufvarname != NULL) { STRCPY(bufvarname, "b:"); STRCPY(bufvarname + 2, varname); set_var(bufvarname, varp, TRUE); vim_free(bufvarname); } } - - /* reset notion of buffer */ - aucmd_restbuf(&aco); } } --- 18508,18547 ---- if (buf != NULL && varname != NULL && varp != NULL) { if (*varname == '&') { long numval; char_u *strval; int error = FALSE; + aco_save_T aco; + + /* set curbuf to be our buf, temporarily */ + aucmd_prepbuf(&aco, buf); ++varname; numval = (long)get_tv_number_chk(varp, &error); strval = get_tv_string_buf_chk(varp, nbuf); if (!error && strval != NULL) set_option_value(varname, numval, strval, OPT_LOCAL); + + /* reset notion of buffer */ + aucmd_restbuf(&aco); } else { + buf_T *save_curbuf = curbuf; + bufvarname = alloc((unsigned)STRLEN(varname) + 3); if (bufvarname != NULL) { + curbuf = buf; STRCPY(bufvarname, "b:"); STRCPY(bufvarname + 2, varname); set_var(bufvarname, varp, TRUE); vim_free(bufvarname); + curbuf = save_curbuf; } } } } *** ../vim-7.4.2042/src/version.c 2016-07-15 17:49:53.211486136 +0200 --- src/version.c 2016-07-15 20:13:26.475119025 +0200 *************** *** 760,761 **** --- 760,763 ---- { /* Add new patch number below this line */ + /**/ + 2043, /**/ -- An extraordinary TALL KNIGHT in all black (possibly John with Mike on his shoulders) walks out from the dark trees. He is extremely fierce and gruesome countenance. He walks towards KING ARTHUR and PATSY, who are wazzing like mad. (Salopian slang, meaning very scared. almost to the point of wetting oneself, e.g. before an important football match or prior to a postering. Salopian slang meaning a beating by the school praeposters. Sorry about the Salopian slant to this stage direction - Ed.) "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///