summaryrefslogtreecommitdiff
path: root/src/ex_getln.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2010-12-02 16:01:29 +0100
committerBram Moolenaar <Bram@vim.org>2010-12-02 16:01:29 +0100
commit94950a9ee02369c9bb26d81be7c20ced166943ec (patch)
tree04d0607739f85878ff8e057215afb8e1b13fbe59 /src/ex_getln.c
parent4161dccada960ec7bf97e5887287d42eb9139710 (diff)
downloadvim-git-94950a9ee02369c9bb26d81be7c20ced166943ec.tar.gz
updated for version 7.3.072v7.3.072
Problem: Can't complete file names while ignoring case. Solution: Add 'wildignorecase'.
Diffstat (limited to 'src/ex_getln.c')
-rw-r--r--src/ex_getln.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/ex_getln.c b/src/ex_getln.c
index dfc6dffcf..66d2ec44a 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -3339,10 +3339,14 @@ nextwild(xp, type, options)
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 @@ nextwild(xp, type, options)
* 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 @@ expand_cmdline(xp, str, col, matchcount, matches)
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 @@ expand_cmdline(xp, str, col, matchcount, matches)
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 @@ ExpandFromContext(xp, pat, num_file, file, options)
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 @@ ExpandFromContext(xp, pat, num_file, file, options)
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)