Attached is a small patch addressing todo item:

In command line window ":close" doesn't work properly. (Tony Mechelynck, 2009
Jun 1)

In addition to not closing the command-line window, the history was
modified when using ":close", when it fact it shouldn't. This behavior
also affected ":q" while in the command-line window.

This patch fixes both issues on my system.

-- 
JR

-- 
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
diff -r 2fd8b123af2e -r 34ba2a2fb961 src/ex_docmd.c
--- a/src/ex_docmd.c    Thu Apr 28 23:10:29 2011 -0400
+++ b/src/ex_docmd.c    Sat Apr 30 22:25:49 2011 -0400
@@ -6458,7 +6458,7 @@
 {
 # ifdef FEAT_CMDWIN
     if (cmdwin_type != 0)
-       cmdwin_result = K_IGNORE;
+       cmdwin_result = Ctrl_C;
     else
 # endif
        if (!text_locked()
diff -r 2fd8b123af2e -r 34ba2a2fb961 src/ex_getln.c
--- a/src/ex_getln.c    Thu Apr 28 23:10:29 2011 -0400
+++ b/src/ex_getln.c    Sat Apr 30 22:25:49 2011 -0400
@@ -6324,6 +6324,12 @@
            ccline.cmdbuff = vim_strsave((char_u *)"qa");
            cmdwin_result = CAR;
        }
+       else if (cmdwin_result == Ctrl_C)
+       {
+           /* :q or :close, don't execute any command
+            * and don't modify the cmd window. */
+           ccline.cmdbuff = NULL;
+       }
        else
            ccline.cmdbuff = vim_strsave(ml_get_curline());
        if (ccline.cmdbuff == NULL)

Raspunde prin e-mail lui