aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/buffer.c32
-rw-r--r--src/nvim/option_defs.h4
-rw-r--r--src/nvim/regexp_defs.h2
-rw-r--r--src/nvim/version.c2
4 files changed, 21 insertions, 19 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c
index f84e25cdfb..8327f3c836 100644
--- a/src/nvim/buffer.c
+++ b/src/nvim/buffer.c
@@ -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(&regmatch, name, (colnr_T)0))
match = name;
else {
diff --git a/src/nvim/option_defs.h b/src/nvim/option_defs.h
index 39dfbe8b88..4422fbc756 100644
--- a/src/nvim/option_defs.h
+++ b/src/nvim/option_defs.h
@@ -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' */
diff --git a/src/nvim/regexp_defs.h b/src/nvim/regexp_defs.h
index 8aa89d22b7..1e00f14ac6 100644
--- a/src/nvim/regexp_defs.h
+++ b/src/nvim/regexp_defs.h
@@ -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;
/*
diff --git a/src/nvim/version.c b/src/nvim/version.c
index e1819865f0..245f797306 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -282,7 +282,7 @@ static int included_patches[] = {
//458,
//457,
//456,
- //455,
+ 455,
454,
//453 NA
//452,