Patch 9.0.0064
Problem:    Confusing error when using "q:" in command line window.
Solution:   Check for the situation and give a better error message.
            (closes #10756)
Files:      src/errors.h, src/normal.c, src/testdir/test_cmdwin.vim


*** ../vim-9.0.0063/src/errors.h        2022-07-23 05:04:07.580839529 +0100
--- src/errors.h        2022-07-24 19:52:24.502674393 +0100
***************
*** 3306,3308 ****
--- 3306,3312 ----
  EXTERN char e_invalid_argument_nr[]
        INIT(= N_("E1291: Invalid argument: %ld"));
  #endif
+ #ifdef FEAT_CMDWIN
+ EXTERN char e_cmdline_window_already_open[]
+       INIT(= N_("E1292: Command-line window is already open"));
+ #endif
*** ../vim-9.0.0063/src/normal.c        2022-06-30 22:13:56.208846322 +0100
--- src/normal.c        2022-07-24 19:52:17.806690841 +0100
***************
*** 7147,7152 ****
--- 7147,7157 ----
  #ifdef FEAT_CMDWIN
        if (cap->nchar == ':' || cap->nchar == '/' || cap->nchar == '?')
        {
+           if (cmdwin_type != 0)
+           {
+               emsg(_(e_cmdline_window_already_open));
+               return;
+           }
            stuffcharReadbuff(cap->nchar);
            stuffcharReadbuff(K_CMDWIN);
        }
*** ../vim-9.0.0063/src/testdir/test_cmdwin.vim 2022-07-02 16:29:15.027193547 
+0100
--- src/testdir/test_cmdwin.vim 2022-07-24 20:06:54.080569588 +0100
***************
*** 356,360 ****
--- 356,369 ----
    call assert_equal('', getcmdwintype())
  endfunc
  
+ func Test_cant_open_cmdwin_in_cmdwin()
+   try
+     call feedkeys("q:q::q\<CR>", "x!")
+   catch
+     let caught = v:exception
+   endtry
+   call assert_match('E1292:', caught)
+ endfunc
+ 
  
  " vim: shiftwidth=2 sts=2 expandtab
*** ../vim-9.0.0063/src/version.c       2022-07-23 09:52:00.341814264 +0100
--- src/version.c       2022-07-24 19:53:41.222486502 +0100
***************
*** 737,738 ****
--- 737,740 ----
  {   /* Add new patch number below this line */
+ /**/
+     64,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
111. You and your friends get together regularly on IRC, even though
     all of you live in the same street.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20220724190837.3C5821C065C%40moolenaar.net.

Raspunde prin e-mail lui