summaryrefslogtreecommitdiff
path: root/src/window.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-05-30 17:29:40 +0200
committerBram Moolenaar <Bram@vim.org>2019-05-30 17:29:40 +0200
commit89adc3a1371d211f7766f3dbc0975ecb2f862327 (patch)
tree5ece2c55b14bd899f995e12df256875572c0d23f /src/window.c
parent5c3fb04623d0260762f1c3c1ba250a407098ff2a (diff)
downloadvim-git-89adc3a1371d211f7766f3dbc0975ecb2f862327.tar.gz
patch 8.1.1425: win_execute() does not set window pointers properlyv8.1.1425
Problem: Win_execute() does not set window pointers properly. Solution: Use switch_win_noblock(). Also execute autocommands in a popup window.
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c34
1 files changed, 30 insertions, 4 deletions
diff --git a/src/window.c b/src/window.c
index 0a8ef8f25..07c8780df 100644
--- a/src/window.c
+++ b/src/window.c
@@ -6495,6 +6495,20 @@ switch_win(
int no_display)
{
block_autocmds();
+ return switch_win_noblock(save_curwin, save_curtab, win, tp, no_display);
+}
+
+/*
+ * As switch_win() but without blocking autocommands.
+ */
+ int
+switch_win_noblock(
+ win_T **save_curwin,
+ tabpage_T **save_curtab,
+ win_T *win,
+ tabpage_T *tp,
+ int no_display)
+{
*save_curwin = curwin;
if (tp != NULL)
{
@@ -6524,9 +6538,22 @@ switch_win(
*/
void
restore_win(
- win_T *save_curwin UNUSED,
- tabpage_T *save_curtab UNUSED,
- int no_display UNUSED)
+ win_T *save_curwin,
+ tabpage_T *save_curtab,
+ int no_display)
+{
+ restore_win_noblock(save_curwin, save_curtab, no_display);
+ unblock_autocmds();
+}
+
+/*
+ * As restore_win() but without unblocking autocommands.
+ */
+ void
+restore_win_noblock(
+ win_T *save_curwin,
+ tabpage_T *save_curtab,
+ int no_display)
{
if (save_curtab != NULL && valid_tabpage(save_curtab))
{
@@ -6546,7 +6573,6 @@ restore_win(
curwin = save_curwin;
curbuf = curwin->w_buffer;
}
- unblock_autocmds();
}
/*