diff options
author | Bram Moolenaar <Bram@vim.org> | 2014-09-19 14:26:36 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2014-09-19 14:26:36 +0200 |
commit | 5d2bae8b1c2bb8059010ea604e092de9cf3c1baf (patch) | |
tree | 4e08dc4660c82fa64e4da92e50e7e99698119d25 /src/window.c | |
parent | 714db3bb819bb7f9f52270f2352b274bba3a9ff4 (diff) | |
download | vim-git-5d2bae8b1c2bb8059010ea604e092de9cf3c1baf.tar.gz |
updated for version 7.4.446v7.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)
Diffstat (limited to 'src/window.c')
-rw-r--r-- | src/window.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/window.c b/src/window.c index 5012427fa..0088e3264 100644 --- a/src/window.c +++ b/src/window.c @@ -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 |