summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-10-01 22:37:40 +0200
committerBram Moolenaar <Bram@vim.org>2020-10-01 22:37:40 +0200
commitbdf931c25b4fe78877106ca529baee7899d0f6a4 (patch)
tree693f3dea4f0ab3c290b72b4dcc9b46cd5877c74e
parent74273e66914e46eb5814c13a1b888e45358859b6 (diff)
downloadvim-git-bdf931c25b4fe78877106ca529baee7899d0f6a4.tar.gz
patch 8.2.1783: try-catch test failsv8.2.1783
Problem: Try-catch test fails. Solution: Don't call win_enter(), only call enterering_window().
-rw-r--r--src/autocmd.c10
-rw-r--r--src/proto/window.pro1
-rw-r--r--src/testdir/runtest.vim5
-rw-r--r--src/version.c2
-rw-r--r--src/window.c2
5 files changed, 16 insertions, 4 deletions
diff --git a/src/autocmd.c b/src/autocmd.c
index 4c2b70596..57b5674e1 100644
--- a/src/autocmd.c
+++ b/src/autocmd.c
@@ -1533,18 +1533,22 @@ win_found:
unblock_autocmds();
if (win_valid(aco->save_curwin))
- win_enter(aco->save_curwin, TRUE);
+ curwin = aco->save_curwin;
else
// Hmm, original window disappeared. Just use the first one.
curwin = firstwin;
+ curbuf = curwin->w_buffer;
+#ifdef FEAT_JOB_CHANNEL
+ // May need to restore insert mode for a prompt buffer.
+ entering_window(curwin);
+#endif
+
if (win_valid(aco->save_prevwin))
prevwin = aco->save_prevwin;
#ifdef FEAT_EVAL
vars_clear(&aucmd_win->w_vars->dv_hashtab); // free all w: variables
hash_init(&aucmd_win->w_vars->dv_hashtab); // re-use the hashtab
#endif
- curbuf = curwin->w_buffer;
-
vim_free(globaldir);
globaldir = aco->globaldir;
diff --git a/src/proto/window.pro b/src/proto/window.pro
index 4c9bddd28..24ab0ec82 100644
--- a/src/proto/window.pro
+++ b/src/proto/window.pro
@@ -10,6 +10,7 @@ int win_count(void);
int make_windows(int count, int vertical);
void win_move_after(win_T *win1, win_T *win2);
void win_equal(win_T *next_curwin, int current, int dir);
+void entering_window(win_T *win);
void close_windows(buf_T *buf, int keep_curwin);
int one_window(void);
int win_close(win_T *win, int free_buf);
diff --git a/src/testdir/runtest.vim b/src/testdir/runtest.vim
index 3ff8c675f..08b1f8ec8 100644
--- a/src/testdir/runtest.vim
+++ b/src/testdir/runtest.vim
@@ -227,7 +227,12 @@ func RunTheTest(test)
" Close any extra tab pages and windows and make the current one not modified.
while tabpagenr('$') > 1
+ let winid = win_getid()
quit!
+ if winid == win_getid()
+ echoerr 'Could not quit window'
+ break
+ endif
endwhile
while 1
diff --git a/src/version.c b/src/version.c
index 9619a334e..d2d285f10 100644
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1783,
+/**/
1782,
/**/
1781,
diff --git a/src/window.c b/src/window.c
index 64017bfeb..034a0d924 100644
--- a/src/window.c
+++ b/src/window.c
@@ -2227,7 +2227,7 @@ leaving_window(win_T *win)
}
}
- static void
+ void
entering_window(win_T *win)
{
// Only matters for a prompt window.