diff src/autocmd.c @ 22470:f7471450243c v8.2.1783

patch 8.2.1783: try-catch test fails Commit: https://github.com/vim/vim/commit/bdf931c25b4fe78877106ca529baee7899d0f6a4 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Oct 1 22:37:40 2020 +0200 patch 8.2.1783: try-catch test fails Problem: Try-catch test fails. Solution: Don't call win_enter(), only call enterering_window().
author Bram Moolenaar <Bram@vim.org>
date Thu, 01 Oct 2020 22:45:05 +0200
parents 18f400b24f5f
children fba5ccf33794
line wrap: on
line diff
--- 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;