mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:7.4.455
Problem: Completion for :buf does not use 'wildignorecase'. (Akshay H) Solution: Pass the 'wildignorecase' flag around. https://code.google.com/p/vim/source/detail?r=v7-4-455
This commit is contained in:
parent
5fe519f78a
commit
7fc7f026ad
@ -1758,7 +1758,7 @@ buflist_findpat (
|
||||
FOR_ALL_BUFFERS(buf) {
|
||||
if (buf->b_p_bl == find_listed
|
||||
&& (!diffmode || diff_mode_buf(buf))
|
||||
&& buflist_match(prog, buf) != NULL) {
|
||||
&& buflist_match(prog, buf, false) != NULL) {
|
||||
if (curtab_only) {
|
||||
/* Ignore the match if the buffer is not open in
|
||||
* the current tab. */
|
||||
@ -1852,7 +1852,7 @@ int ExpandBufnames(char_u *pat, int *num_file, char_u ***file, int options)
|
||||
FOR_ALL_BUFFERS(buf) {
|
||||
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)
|
||||
++count;
|
||||
@ -1885,26 +1885,27 @@ int ExpandBufnames(char_u *pat, int *num_file, char_u ***file, int options)
|
||||
|
||||
|
||||
#ifdef HAVE_BUFLIST_MATCH
|
||||
/*
|
||||
* Check for a match on the file name for buffer "buf" with regprog "prog".
|
||||
*/
|
||||
static char_u *buflist_match(regprog_T *prog, buf_T *buf)
|
||||
/// Check for a match on the file name for buffer "buf" with regprog "prog".
|
||||
///
|
||||
/// @param ignore_case When TRUE, ignore case. Use 'fic' otherwise.
|
||||
static char_u *buflist_match(regprog_T *prog, buf_T *buf, bool ignore_case)
|
||||
{
|
||||
char_u *match;
|
||||
|
||||
/* First try the short file name, then the long file name. */
|
||||
match = fname_match(prog, buf->b_sfname);
|
||||
if (match == NULL)
|
||||
match = fname_match(prog, buf->b_ffname);
|
||||
match = fname_match(prog, buf->b_sfname, ignore_case);
|
||||
if (match == NULL) {
|
||||
match = fname_match(prog, buf->b_ffname, ignore_case);
|
||||
}
|
||||
|
||||
return match;
|
||||
}
|
||||
|
||||
/*
|
||||
* Try matching the regexp in "prog" with file name "name".
|
||||
* Return "name" when there is a match, NULL when not.
|
||||
*/
|
||||
static char_u *fname_match(regprog_T *prog, char_u *name)
|
||||
/// Try matching the regexp in "prog" with file name "name".
|
||||
///
|
||||
/// @param ignore_case When TRUE, ignore case. Use 'fileignorecase' otherwise.
|
||||
/// @return "name" when there is a match, NULL when not.
|
||||
static char_u *fname_match(regprog_T *prog, char_u *name, bool ignore_case)
|
||||
{
|
||||
char_u *match = NULL;
|
||||
char_u *p;
|
||||
@ -1912,7 +1913,8 @@ static char_u *fname_match(regprog_T *prog, char_u *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(®match, name, (colnr_T)0))
|
||||
match = name;
|
||||
else {
|
||||
|
@ -369,7 +369,7 @@ EXTERN int p_ek; /* 'esckeys' */
|
||||
EXTERN int p_exrc; /* 'exrc' */
|
||||
EXTERN char_u *p_fencs; /* 'fileencodings' */
|
||||
EXTERN char_u *p_ffs; /* 'fileformats' */
|
||||
EXTERN long p_fic; /* 'fileignorecase' */
|
||||
EXTERN bool p_fic; ///< 'fileignorecase'
|
||||
EXTERN char_u *p_fcl; /* 'foldclose' */
|
||||
EXTERN long p_fdls; /* 'foldlevelstart' */
|
||||
EXTERN char_u *p_fdo; /* 'foldopen' */
|
||||
@ -621,7 +621,7 @@ EXTERN int p_wiv; /* 'weirdinvert' */
|
||||
EXTERN char_u *p_ww; /* 'whichwrap' */
|
||||
EXTERN long p_wc; /* 'wildchar' */
|
||||
EXTERN long p_wcm; /* 'wildcharm' */
|
||||
EXTERN long p_wic; /* 'wildignorecase' */
|
||||
EXTERN bool p_wic; ///< 'wildignorecase'
|
||||
EXTERN char_u *p_wim; /* 'wildmode' */
|
||||
EXTERN int p_wmnu; /* 'wildmenu' */
|
||||
EXTERN long p_wh; /* 'winheight' */
|
||||
|
@ -108,7 +108,7 @@ typedef struct {
|
||||
regprog_T *regprog;
|
||||
char_u *startp[NSUBEXP];
|
||||
char_u *endp[NSUBEXP];
|
||||
int rm_ic;
|
||||
bool rm_ic;
|
||||
} regmatch_T;
|
||||
|
||||
/*
|
||||
|
@ -282,7 +282,7 @@ static int included_patches[] = {
|
||||
//458,
|
||||
//457,
|
||||
//456,
|
||||
//455,
|
||||
455,
|
||||
454,
|
||||
//453 NA
|
||||
//452,
|
||||
|
Loading…
Reference in New Issue
Block a user