]> granicus.if.org Git - vim/commitdiff
patch 8.2.4454: resetting cmdwin_type only for one situation v8.2.4454
authorzeertzjq <zeertzjq@outlook.com>
Wed, 23 Feb 2022 12:23:08 +0000 (12:23 +0000)
committerBram Moolenaar <Bram@vim.org>
Wed, 23 Feb 2022 12:23:08 +0000 (12:23 +0000)
Problem:    Resetting cmdwin_type only for one situation.
Solution:   Reset cmdwin_type before closing windows. (closes #9822)

src/testdir/test_exit.vim
src/ui.c
src/version.c
src/window.c

index 7e50e78ba41a737522528b891b0a40c6456c124d..c05374cb86654d8337629bef98777d14b285dcc4 100644 (file)
@@ -119,6 +119,7 @@ func Test_exit_error_reading_input()
   call writefile([":au VimLeave * call writefile(['l = ' .. v:exiting], 'Xtestout')", ":tabnew", "q:"], 'Xscript', 'b')
 
   if RunVim([], [], '<Xscript')
+    call assert_equal(1, v:shell_error)
     call assert_equal(['l = 1'], readfile('Xtestout'))
   endif
   call delete('Xscript')
index bf6ea858b046ba87c065a497c961fa00f4199065..a6cee804ad47de056543e2f8158c25e833e4602a 100644 (file)
--- a/src/ui.c
+++ b/src/ui.c
@@ -1065,9 +1065,6 @@ 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();
 }
 
index 57f32cbe4a990e6f2c2ce8e8595657d2cb88884d..5da1833d2526dd6e221cfcba0c583cb3a20afe46 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4454,
 /**/
     4453,
 /**/
index 7da7b89e858f0aafd29cf20dcf893a0be78af6e3..ceb7d59585c88396adb818f52137d1f73b6d83ce 100644 (file)
@@ -2856,6 +2856,10 @@ win_free_all(void)
 {
     int                dummy;
 
+#ifdef FEAT_CMDWIN
+    // avoid an error for switching tabpage with the cmdline window open
+    cmdwin_type = 0;
+#endif
     while (first_tabpage->tp_next != NULL)
        tabpage_close(TRUE);