]> granicus.if.org Git - vim/commitdiff
patch 8.2.2416: may get stuck in command line window state v8.2.2416
authorBram Moolenaar <Bram@vim.org>
Wed, 27 Jan 2021 19:34:29 +0000 (20:34 +0100)
committerBram Moolenaar <Bram@vim.org>
Wed, 27 Jan 2021 19:34:29 +0000 (20:34 +0100)
Problem:    May get stuck in command line window state.
Solution:   Reset "cmdwin_type" when editing buffer fails.  Make arglist test
            pass on MS-Windows.

src/ex_getln.c
src/testdir/test_arglist.vim
src/version.c

index d025368218a29623dd4bdf69a15eccc75796beb5..d6712c126a2cf5fc387fd0b38564adfdd8de1fe3 100644 (file)
@@ -4214,6 +4214,7 @@ open_cmdwin(void)
        // Some autocommand messed it up?
        win_close(curwin, TRUE);
        ga_clear(&winsizes);
+       cmdwin_type = 0;
        return Ctrl_C;
     }
 
index 62029934900510c78acf65cb6c4ac8e28783a5b5..4f169416ad9d42ad6f1a90a361782d0bf372cc3e 100644 (file)
@@ -563,12 +563,18 @@ endfunc
 " Test for ":all" not working when in the cmdline window
 func Test_all_not_allowed_from_cmdwin()
   CheckFeature cmdwin
-  " TODO: why does this hang on Windows?
-  CheckNotMSWindows
 
   au BufEnter * all
   next x
-  call assert_fails(":norm 7q?print\<CR>", 'E11:')
+  " Use try/catch here, somehow assert_fails() doesn't work on MS-Windows
+  " console.
+  let caught = 'no'
+  try
+    exe ":norm! 7q?apat\<CR>"
+  catch /E11:/
+    let caught = 'yes'
+  endtry
+  call assert_equal('yes', caught)
   au! BufEnter
 endfunc
 
index 24a1d7fd44f97aa1689dd50803f3b670d6baca22..17ca2717d98b8ae32a3c9fd2e491f37aca039921 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2416,
 /**/
     2415,
 /**/