changeset 6241:ebc72764fa1e v7.4.455

updated for version 7.4.455 Problem: Completion for :buf does not use 'wildignorecase'. (Akshay H) Solution: Pass the 'wildignorecase' flag around.
author Bram Moolenaar <bram@vim.org>
date Tue, 23 Sep 2014 14:24:40 +0200
parents 641dfb9437f6
children edb2f4f3547d
files src/buffer.c src/version.c
diffstat 2 files changed, 14 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -28,9 +28,9 @@
 #include "vim.h"
 
 #if defined(FEAT_CMDL_COMPL) || defined(FEAT_LISTCMDS) || defined(FEAT_EVAL) || defined(FEAT_PERL)
-static char_u	*buflist_match __ARGS((regprog_T *prog, buf_T *buf));
+static char_u	*buflist_match __ARGS((regprog_T *prog, buf_T *buf, int ignore_case));
 # define HAVE_BUFLIST_MATCH
-static char_u	*fname_match __ARGS((regprog_T *prog, char_u *name));
+static char_u	*fname_match __ARGS((regprog_T *prog, char_u *name, int ignore_case));
 #endif
 static void	buflist_setfpos __ARGS((buf_T *buf, win_T *win, linenr_T lnum, colnr_T col, int copy_options));
 static wininfo_T *find_wininfo __ARGS((buf_T *buf, int skip_diff_buffer));
@@ -2282,7 +2282,7 @@ buflist_findpat(pattern, pattern_end, un
 #ifdef FEAT_DIFF
 			    && (!diffmode || diff_mode_buf(buf))
 #endif
-			    && buflist_match(prog, buf) != NULL)
+			    && buflist_match(prog, buf, FALSE) != NULL)
 		    {
 			if (curtab_only)
 			{
@@ -2396,7 +2396,7 @@ ExpandBufnames(pat, num_file, file, opti
 	    {
 		if (!buf->b_p_bl)	/* skip unlisted buffers */
 		    continue;
-		p = buflist_match(prog, buf);
+		p = buflist_match(prog, buf, p_wic);
 		if (p != NULL)
 		{
 		    if (round == 1)
@@ -2444,16 +2444,17 @@ ExpandBufnames(pat, num_file, file, opti
  * Check for a match on the file name for buffer "buf" with regprog "prog".
  */
     static char_u *
-buflist_match(prog, buf)
+buflist_match(prog, buf, ignore_case)
     regprog_T	*prog;
     buf_T	*buf;
+    int		ignore_case;  /* when TRUE ignore case, when FALSE use 'fic' */
 {
     char_u	*match;
 
     /* First try the short file name, then the long file name. */
-    match = fname_match(prog, buf->b_sfname);
+    match = fname_match(prog, buf->b_sfname, ignore_case);
     if (match == NULL)
-	match = fname_match(prog, buf->b_ffname);
+	match = fname_match(prog, buf->b_ffname, ignore_case);
 
     return match;
 }
@@ -2463,9 +2464,10 @@ buflist_match(prog, buf)
  * Return "name" when there is a match, NULL when not.
  */
     static char_u *
-fname_match(prog, name)
+fname_match(prog, name, ignore_case)
     regprog_T	*prog;
     char_u	*name;
+    int		ignore_case;  /* when TRUE ignore case, when FALSE use 'fic' */
 {
     char_u	*match = NULL;
     char_u	*p;
@@ -2474,7 +2476,8 @@ fname_match(prog, name)
     if (name != NULL)
     {
 	regmatch.regprog = prog;
-	regmatch.rm_ic = p_fic;	/* ignore case when 'fileignorecase' is set */
+	/* Ignore case when 'fileignorecase' or the argument is set. */
+	regmatch.rm_ic = p_fic || ignore_case;
 	if (vim_regexec(&regmatch, name, (colnr_T)0))
 	    match = name;
 	else
--- a/src/version.c
+++ b/src/version.c
@@ -742,6 +742,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    455,
+/**/
     454,
 /**/
     453,