mirror of
https://github.com/vim/vim.git
synced 2025-07-04 23:07:33 -04:00
patch 9.0.0066: switching window uneccarily when getting buffer options
Problem: Switching window uneccarily when getting buffer options. Solution: Do not switch window when getting buffer options. (closes #10767)
This commit is contained in:
parent
509695c1c3
commit
cd6ad6439d
@ -4098,6 +4098,7 @@ get_var_from(
|
|||||||
int done = FALSE;
|
int done = FALSE;
|
||||||
switchwin_T switchwin;
|
switchwin_T switchwin;
|
||||||
int need_switch_win;
|
int need_switch_win;
|
||||||
|
int do_change_curbuf = buf != NULL && htname == 'b';
|
||||||
|
|
||||||
++emsg_off;
|
++emsg_off;
|
||||||
|
|
||||||
@ -4112,7 +4113,7 @@ get_var_from(
|
|||||||
// autocommands get blocked.
|
// autocommands get blocked.
|
||||||
// If we have a buffer reference avoid the switching, we're saving and
|
// If we have a buffer reference avoid the switching, we're saving and
|
||||||
// restoring curbuf directly.
|
// restoring curbuf directly.
|
||||||
need_switch_win = !(tp == curtab && win == curwin) || (buf != NULL);
|
need_switch_win = !(tp == curtab && win == curwin) && !do_change_curbuf;
|
||||||
if (!need_switch_win || switch_win(&switchwin, win, tp, TRUE) == OK)
|
if (!need_switch_win || switch_win(&switchwin, win, tp, TRUE) == OK)
|
||||||
{
|
{
|
||||||
// Handle options. There are no tab-local options.
|
// Handle options. There are no tab-local options.
|
||||||
@ -4121,12 +4122,12 @@ get_var_from(
|
|||||||
buf_T *save_curbuf = curbuf;
|
buf_T *save_curbuf = curbuf;
|
||||||
|
|
||||||
// Change curbuf so the option is read from the correct buffer.
|
// Change curbuf so the option is read from the correct buffer.
|
||||||
if (buf != NULL && htname == 'b')
|
if (do_change_curbuf)
|
||||||
curbuf = buf;
|
curbuf = buf;
|
||||||
|
|
||||||
if (varname[1] == NUL)
|
if (varname[1] == NUL)
|
||||||
{
|
{
|
||||||
// get all window-local options in a dict
|
// get all window-local or buffer-local options in a dict
|
||||||
dict_T *opts = get_winbuf_options(htname == 'b');
|
dict_T *opts = get_winbuf_options(htname == 'b');
|
||||||
|
|
||||||
if (opts != NULL)
|
if (opts != NULL)
|
||||||
|
@ -735,6 +735,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 */
|
||||||
|
/**/
|
||||||
|
66,
|
||||||
/**/
|
/**/
|
||||||
65,
|
65,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user