diff options
-rw-r--r-- | src/nvim/memory.c | 3 | ||||
-rw-r--r-- | src/nvim/testdir/test_exit.vim | 1 | ||||
-rw-r--r-- | src/nvim/window.c | 3 |
3 files changed, 4 insertions, 3 deletions
diff --git a/src/nvim/memory.c b/src/nvim/memory.c index 373693a6fe..d68ca6b62e 100644 --- a/src/nvim/memory.c +++ b/src/nvim/memory.c @@ -575,9 +575,6 @@ void free_all_mem(void) // Don't want to trigger autocommands from here on. block_autocmds(); - // Ensure cmdline window doesn't prevent closing tabs and windows. - cmdwin_type = 0; - // Close all tabs and windows. Reset 'equalalways' to avoid redraws. p_ea = false; if (first_tabpage->tp_next != NULL) { diff --git a/src/nvim/testdir/test_exit.vim b/src/nvim/testdir/test_exit.vim index 4e5da49adb..befcaec2b2 100644 --- a/src/nvim/testdir/test_exit.vim +++ b/src/nvim/testdir/test_exit.vim @@ -123,6 +123,7 @@ func Test_exit_error_reading_input() " Nvim requires "-s -" to read stdin as Normal mode input " if RunVim([], [], '<Xscript') if RunVim([], [], '-s - <Xscript') + call assert_equal(1, v:shell_error) call assert_equal(['l = 1'], readfile('Xtestout')) endif call delete('Xscript') diff --git a/src/nvim/window.c b/src/nvim/window.c index 3c34620db4..f2b84a4124 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -2904,6 +2904,9 @@ void win_free_all(void) { int dummy; + // avoid an error for switching tabpage with the cmdline window open + cmdwin_type = 0; + while (first_tabpage->tp_next != NULL) { tabpage_close(TRUE); } |