Karsten Hopp 88c605
To: vim-dev@vim.org
Karsten Hopp 88c605
Subject: patch 7.1.083
Karsten Hopp 88c605
Fcc: outbox
Karsten Hopp 88c605
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 88c605
Mime-Version: 1.0
Karsten Hopp 88c605
Content-Type: text/plain; charset=ISO-8859-1
Karsten Hopp 88c605
Content-Transfer-Encoding: 8bit
Karsten Hopp 88c605
------------
Karsten Hopp 88c605
Karsten Hopp 88c605
Patch 7.1.083 (after 7.1.081)
Karsten Hopp 88c605
Problem:    Command line completion doesn't work with wildcards.
Karsten Hopp 88c605
Solution:   Add vim_isfilec_or_wc() and use it. (Martin Toft)
Karsten Hopp 88c605
Files:	    src/charset.c, src/proto/charset.pro, src/ex_docmd.c
Karsten Hopp 88c605
Karsten Hopp 88c605
Karsten Hopp 88c605
*** ../vim-7.1.082/src/charset.c	Wed Aug 15 20:40:45 2007
Karsten Hopp 88c605
--- src/charset.c	Sun Aug 19 22:30:25 2007
Karsten Hopp 88c605
***************
Karsten Hopp 88c605
*** 932,937 ****
Karsten Hopp 88c605
--- 932,954 ----
Karsten Hopp 88c605
  }
Karsten Hopp 88c605
  
Karsten Hopp 88c605
  /*
Karsten Hopp 88c605
+  * return TRUE if 'c' is a valid file-name character or a wildcard character
Karsten Hopp 88c605
+  * Assume characters above 0x100 are valid (multi-byte).
Karsten Hopp 88c605
+  * Explicitly interpret ']' as a wildcard character as mch_has_wildcard("]")
Karsten Hopp 88c605
+  * returns false.
Karsten Hopp 88c605
+  */
Karsten Hopp 88c605
+     int
Karsten Hopp 88c605
+ vim_isfilec_or_wc(c)
Karsten Hopp 88c605
+     int c;
Karsten Hopp 88c605
+ {
Karsten Hopp 88c605
+     char_u buf[2];
Karsten Hopp 88c605
+ 
Karsten Hopp 88c605
+     buf[0] = (char_u)c;
Karsten Hopp 88c605
+     buf[1] = NUL;
Karsten Hopp 88c605
+     return vim_isfilec(c) || c == ']' || mch_has_wildcard(buf);
Karsten Hopp 88c605
+ }
Karsten Hopp 88c605
+ 
Karsten Hopp 88c605
+ /*
Karsten Hopp 88c605
   * return TRUE if 'c' is a printable character
Karsten Hopp 88c605
   * Assume characters above 0x100 are printable (multi-byte), except for
Karsten Hopp 88c605
   * Unicode.
Karsten Hopp 88c605
*** ../vim-7.1.082/src/proto/charset.pro	Sat May  5 19:21:32 2007
Karsten Hopp 88c605
--- src/proto/charset.pro	Sun Aug 19 22:30:28 2007
Karsten Hopp 88c605
***************
Karsten Hopp 88c605
*** 21,26 ****
Karsten Hopp 88c605
--- 21,27 ----
Karsten Hopp 88c605
  int vim_iswordp __ARGS((char_u *p));
Karsten Hopp 88c605
  int vim_iswordc_buf __ARGS((char_u *p, buf_T *buf));
Karsten Hopp 88c605
  int vim_isfilec __ARGS((int c));
Karsten Hopp 88c605
+ int vim_isfilec_or_wc __ARGS((int c));
Karsten Hopp 88c605
  int vim_isprintc __ARGS((int c));
Karsten Hopp 88c605
  int vim_isprintc_strict __ARGS((int c));
Karsten Hopp 88c605
  int lbr_chartabsize __ARGS((unsigned char *s, colnr_T col));
Karsten Hopp 88c605
*** ../vim-7.1.082/src/ex_docmd.c	Sat Aug 18 17:46:50 2007
Karsten Hopp 88c605
--- src/ex_docmd.c	Sun Aug 19 22:29:17 2007
Karsten Hopp 88c605
***************
Karsten Hopp 88c605
*** 3311,3319 ****
Karsten Hopp 88c605
  		in_quote = !in_quote;
Karsten Hopp 88c605
  	    }
Karsten Hopp 88c605
  #ifdef SPACE_IN_FILENAME
Karsten Hopp 88c605
! 	    else if (!vim_isfilec(c) && (!(ea.argt & NOSPC) || usefilter))
Karsten Hopp 88c605
  #else
Karsten Hopp 88c605
! 	    else if (!vim_isfilec(c))
Karsten Hopp 88c605
  #endif
Karsten Hopp 88c605
  	    {
Karsten Hopp 88c605
  		while (*p != NUL)
Karsten Hopp 88c605
--- 3311,3320 ----
Karsten Hopp 88c605
  		in_quote = !in_quote;
Karsten Hopp 88c605
  	    }
Karsten Hopp 88c605
  #ifdef SPACE_IN_FILENAME
Karsten Hopp 88c605
! 	    else if (!vim_isfilec_or_wc(c)
Karsten Hopp 88c605
! 					 && (!(ea.argt & NOSPC) || usefilter))
Karsten Hopp 88c605
  #else
Karsten Hopp 88c605
! 	    else if (!vim_isfilec_or_wc(c))
Karsten Hopp 88c605
  #endif
Karsten Hopp 88c605
  	    {
Karsten Hopp 88c605
  		while (*p != NUL)
Karsten Hopp 88c605
***************
Karsten Hopp 88c605
*** 3324,3330 ****
Karsten Hopp 88c605
  		    else
Karsten Hopp 88c605
  #endif
Karsten Hopp 88c605
  			c = *p;
Karsten Hopp 88c605
! 		    if (c == '`' || vim_isfilec(c))
Karsten Hopp 88c605
  			break;
Karsten Hopp 88c605
  #ifdef FEAT_MBYTE
Karsten Hopp 88c605
  		    if (has_mbyte)
Karsten Hopp 88c605
--- 3325,3331 ----
Karsten Hopp 88c605
  		    else
Karsten Hopp 88c605
  #endif
Karsten Hopp 88c605
  			c = *p;
Karsten Hopp 88c605
! 		    if (c == '`' || vim_isfilec_or_wc(c))
Karsten Hopp 88c605
  			break;
Karsten Hopp 88c605
  #ifdef FEAT_MBYTE
Karsten Hopp 88c605
  		    if (has_mbyte)
Karsten Hopp 88c605
*** ../vim-7.1.082/src/version.c	Sat Aug 18 18:20:57 2007
Karsten Hopp 88c605
--- src/version.c	Sun Aug 19 22:31:43 2007
Karsten Hopp 88c605
***************
Karsten Hopp 88c605
*** 668,669 ****
Karsten Hopp 88c605
--- 668,671 ----
Karsten Hopp 88c605
  {   /* Add new patch number below this line */
Karsten Hopp 88c605
+ /**/
Karsten Hopp 88c605
+     83,
Karsten Hopp 88c605
  /**/
Karsten Hopp 88c605
Karsten Hopp 88c605
-- 
Karsten Hopp 88c605
    "You mean there really is an answer?"
Karsten Hopp 88c605
    "Yes! But you're not going to like it!"
Karsten Hopp 88c605
    "Oh do please tell us!"
Karsten Hopp 88c605
    "You're really not going to like it!"
Karsten Hopp 88c605
    "but we MUST know - tell us"
Karsten Hopp 88c605
    "Alright, the answer is...."
Karsten Hopp 88c605
    "yes..."
Karsten Hopp 88c605
    "... is ..."
Karsten Hopp 88c605
    "yes... come on!"
Karsten Hopp 88c605
    "is 42!"
Karsten Hopp 88c605
		(Douglas Adams - The Hitchhiker's Guide to the Galaxy)
Karsten Hopp 88c605
Karsten Hopp 88c605
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 88c605
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 88c605
\\\        download, build and distribute -- http://www.A-A-P.org        ///
Karsten Hopp 88c605
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///