diff options
| -rw-r--r-- | src/nvim/autocmd.c | 7 | ||||
| -rw-r--r-- | src/nvim/testdir/runtest.vim | 5 | ||||
| -rw-r--r-- | src/nvim/window.c | 2 | 
3 files changed, 11 insertions, 3 deletions
| diff --git a/src/nvim/autocmd.c b/src/nvim/autocmd.c index e274d00a77..9044657358 100644 --- a/src/nvim/autocmd.c +++ b/src/nvim/autocmd.c @@ -1208,15 +1208,18 @@ win_found:      win_T *const save_curwin = win_find_by_handle(aco->save_curwin_handle);      if (save_curwin != NULL) { -      win_enter(save_curwin, true); +      curwin = save_curwin;      } else {        // Hmm, original window disappeared.  Just use the first one.        curwin = firstwin;      } +    curbuf = curwin->w_buffer; +    // May need to restore insert mode for a prompt buffer. +    entering_window(curwin); +      prevwin = win_find_by_handle(aco->save_prevwin_handle);      vars_clear(&aucmd_win->w_vars->dv_hashtab);         // free all w: variables      hash_init(&aucmd_win->w_vars->dv_hashtab);          // re-use the hashtab -    curbuf = curwin->w_buffer;      xfree(globaldir);      globaldir = aco->globaldir; diff --git a/src/nvim/testdir/runtest.vim b/src/nvim/testdir/runtest.vim index 49993c03aa..ab047fd2a8 100644 --- a/src/nvim/testdir/runtest.vim +++ b/src/nvim/testdir/runtest.vim @@ -197,7 +197,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/nvim/window.c b/src/nvim/window.c index ddf50b47a7..e0ba4b72f3 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -2256,7 +2256,7 @@ static void leaving_window(win_T *const win)    }  } -static void entering_window(win_T *const win) +void entering_window(win_T *const win)    FUNC_ATTR_NONNULL_ALL  {    // Only matters for a prompt window. | 
