updated for version 7.3.072
Problem: Can't complete file names while ignoring case.
Solution: Add 'wildignorecase'.
diff --git a/src/ex_getln.c b/src/ex_getln.c
index dfc6dff..66d2ec4 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -3339,10 +3339,14 @@
p2 = NULL;
else
{
+ int use_options = options |
+ WILD_HOME_REPLACE|WILD_ADD_SLASH|WILD_SILENT|WILD_ESCAPE;
+
+ if (p_wic)
+ use_options += WILD_ICASE;
p2 = ExpandOne(xp, p1,
vim_strnsave(&ccline.cmdbuff[i], xp->xp_pattern_len),
- WILD_HOME_REPLACE|WILD_ADD_SLASH|WILD_SILENT|WILD_ESCAPE
- |options, type);
+ use_options, type);
vim_free(p1);
/* longest match: make sure it is not shorter, happens with :help */
if (p2 != NULL && type == WILD_LONGEST)
@@ -3428,6 +3432,7 @@
* options = WILD_KEEP_ALL: don't remove 'wildignore' entries
* options = WILD_SILENT: don't print warning messages
* options = WILD_ESCAPE: put backslash before special chars
+ * options = WILD_ICASE: ignore case for files
*
* The variables xp->xp_context and xp->xp_backslash must have been set!
*/
@@ -4361,6 +4366,7 @@
char_u ***matches; /* return: array of pointers to matches */
{
char_u *file_str = NULL;
+ int options = WILD_ADD_SLASH|WILD_SILENT;
if (xp->xp_context == EXPAND_UNSUCCESSFUL)
{
@@ -4379,9 +4385,11 @@
if (file_str == NULL)
return EXPAND_UNSUCCESSFUL;
+ if (p_wic)
+ options += WILD_ICASE;
+
/* find all files that match the description */
- if (ExpandFromContext(xp, file_str, matchcount, matches,
- WILD_ADD_SLASH|WILD_SILENT) == FAIL)
+ if (ExpandFromContext(xp, file_str, matchcount, matches, options) == FAIL)
{
*matchcount = 0;
*matches = NULL;
@@ -4433,7 +4441,7 @@
char_u *pat;
int *num_file;
char_u ***file;
- int options;
+ int options; /* EW_ flags */
{
#ifdef FEAT_CMDL_COMPL
regmatch_T regmatch;
@@ -4487,6 +4495,9 @@
flags |= (EW_FILE | EW_PATH);
else
flags = (flags | EW_DIR) & ~EW_FILE;
+ if (options & WILD_ICASE)
+ flags |= EW_ICASE;
+
/* Expand wildcards, supporting %:h and the like. */
ret = expand_wildcards_eval(&pat, num_file, file, flags);
if (free_pat)