]> granicus.if.org Git - vim/commitdiff
patch 8.2.1783: try-catch test fails v8.2.1783
authorBram Moolenaar <Bram@vim.org>
Thu, 1 Oct 2020 20:37:40 +0000 (22:37 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 1 Oct 2020 20:37:40 +0000 (22:37 +0200)
Problem:    Try-catch test fails.
Solution:   Don't call win_enter(), only call enterering_window().

src/autocmd.c
src/proto/window.pro
src/testdir/runtest.vim
src/version.c
src/window.c

index 4c2b70596392d4e9adab8d131a7de8e9b4f024c8..57b5674e14d2295a19823384959b3be6a101af49 100644 (file)
@@ -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;
 
index 4c9bddd2814478ea269ceab87be8238d4375907d..24ab0ec821afd21db61b488af6a1312212b7af96 100644 (file)
@@ -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);
index 3ff8c675f3d71461125f75f67be4568135f0094c..08b1f8ec88636cd3a48a3e25be75437a59ad5b6b 100644 (file)
@@ -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
index 9619a334efb871627e6f3286fbc227f36b73837e..d2d285f1013dcf785d22759c6757e7d5877bd26b 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1783,
 /**/
     1782,
 /**/
index 64017bfebcba33c20e75dcdaa3267a899ae735bc..034a0d92412da9330c9919d2ebb00094c43d3363 100644 (file)
@@ -2227,7 +2227,7 @@ leaving_window(win_T *win)
     }
 }
 
-    static void
+    void
 entering_window(win_T *win)
 {
     // Only matters for a prompt window.