forked from aniani/vim
updated for version 7.3.072
Problem: Can't complete file names while ignoring case. Solution: Add 'wildignorecase'.
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user