summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-02-22 12:08:07 +0000
committerBram Moolenaar <Bram@vim.org>2022-02-22 12:08:07 +0000
commitca0c1caa36823ea8e61184268d7337e79995352f (patch)
tree5a2044bc653f5d4dc48dd3c0499cab92c152321c
parent0f113e4f7b698fc94c1a8377afdb7249329beaee (diff)
patch 8.2.4438: crash on exit when using cmdline windowv8.2.4438
Problem: Crash on exit when using cmdline window. Solution: Reset "cmdwin_type" before exiting. (closes #9817)
-rw-r--r--src/testdir/test_exit.vim14
-rw-r--r--src/ui.c3
-rw-r--r--src/version.c2
3 files changed, 19 insertions, 0 deletions
diff --git a/src/testdir/test_exit.vim b/src/testdir/test_exit.vim
index 93b8f5171a..b42eebfa85 100644
--- a/src/testdir/test_exit.vim
+++ b/src/testdir/test_exit.vim
@@ -1,6 +1,7 @@
" Tests for exiting Vim.
source shared.vim
+source check.vim
func Test_exiting()
let after =<< trim [CODE]
@@ -109,4 +110,17 @@ func Test_exit_code()
call delete('Xtestout')
endfunc
+func Test_exit_error_reading_input()
+ CheckNotGui
+
+ call writefile([":au VimLeave * call writefile(['l = ' .. v:exiting], 'Xtestout')", ":tabnew\<CR>q:"], 'Xscript')
+
+ if RunVim([], [], '< Xscript')
+ call assert_equal(['l = 1'], readfile('Xtestout'))
+ endif
+ call delete('Xscript')
+ call delete('Xtestout')
+endfun
+
+
" vim: shiftwidth=2 sts=2 expandtab
diff --git a/src/ui.c b/src/ui.c
index a6cee804ad..bf6ea858b0 100644
--- a/src/ui.c
+++ b/src/ui.c
@@ -1065,6 +1065,9 @@ read_error_exit(void)
if (silent_mode) // Normal way to exit for "ex -s"
getout(0);
STRCPY(IObuff, _("Vim: Error reading input, exiting...\n"));
+#ifdef FEAT_CMDWIN
+ cmdwin_type = 0;
+#endif
preserve_exit();
}
diff --git a/src/version.c b/src/version.c
index 7001029010..399aef93c2 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 */
/**/
+ 4438,
+/**/
4437,
/**/
4436,