aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/window.c
diff options
context:
space:
mode:
authorPavel Platto <hinidu@gmail.com>2015-01-20 20:03:39 +0200
committerPavel Platto <hinidu@gmail.com>2015-01-20 21:09:45 +0200
commit85f342a110358358608c05aa1c5c6b433d0cea9a (patch)
treeee27b2801238c324c953d0866bc328b8d0f1f36a /src/nvim/window.c
parentda43f70ba726cc6dfcf3bc8c73b86a5be713cb47 (diff)
downloadrneovim-85f342a110358358608c05aa1c5c6b433d0cea9a.tar.gz
rneovim-85f342a110358358608c05aa1c5c6b433d0cea9a.tar.bz2
rneovim-85f342a110358358608c05aa1c5c6b433d0cea9a.zip
vim-patch: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) https://code.google.com/p/vim/source/detail?r=v7-4-446
Diffstat (limited to 'src/nvim/window.c')
-rw-r--r--src/nvim/window.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/nvim/window.c b/src/nvim/window.c
index cf0977e280..52a1853f4b 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -1024,7 +1024,7 @@ static void win_init(win_T *newp, win_T *oldp, int flags)
}
/*
- * Initialize window "newp" from window"old".
+ * Initialize window "newp" from window "old".
* Only the essential things are copied.
*/
static void win_init_some(win_T *newp, win_T *oldp)
@@ -5190,8 +5190,8 @@ static win_T *restore_snapshot_rec(frame_T *sn, frame_T *fr)
/*
* 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.
@@ -5212,7 +5212,6 @@ int switch_win(win_T **save_curwin, tabpage_T **save_curtab, win_T *win, tabpage
goto_tabpage_tp(tp, FALSE, FALSE);
}
if (!win_valid(win)) {
- unblock_autocmds();
return FAIL;
}
curwin = win;