1
0
forked from aniani/vim

updated for version 7.4.446

Problem:    In some situations, when setting up an environment to trigger an
            autocommand, the environment is not properly restored.
Solution:   Check the return value of switch_win() and call restore_win()
            always.  (Daniel Hahler)
This commit is contained in:
Bram Moolenaar
2014-09-19 14:26:36 +02:00
parent 714db3bb81
commit 5d2bae8b1c
4 changed files with 55 additions and 54 deletions

View File

@@ -1271,7 +1271,7 @@ win_init(newp, oldp, flags)
}
/*
* Initialize window "newp" from window"old".
* Initialize window "newp" from window "old".
* Only the essential things are copied.
*/
static void
@@ -6662,8 +6662,8 @@ restore_snapshot_rec(sn, fr)
|| defined(PROTO)
/*
* Set "win" to be the curwin and "tp" to be the current tab page.
* restore_win() MUST be called to undo.
* No autocommands will be executed.
* restore_win() MUST be called to undo, also when FAIL is returned.
* No autocommands will be executed until restore_win() is called.
* When "no_display" is TRUE the display won't be affected, no redraw is
* triggered, another tabpage access is limited.
* Returns FAIL if switching to "win" failed.
@@ -6696,12 +6696,7 @@ switch_win(save_curwin, save_curtab, win, tp, no_display)
goto_tabpage_tp(tp, FALSE, FALSE);
}
if (!win_valid(win))
{
# ifdef FEAT_AUTOCMD
unblock_autocmds();
# endif
return FAIL;
}
curwin = win;
curbuf = curwin->w_buffer;
# endif