diff options
author | Marco Hinz <mh.codebro@gmail.com> | 2014-12-20 09:31:29 +0100 |
---|---|---|
committer | Florian Walch <florian@fwalch.com> | 2014-12-20 09:41:51 +0100 |
commit | 7fc7f026ad1103b1f6670507cd9cd7a816ae3539 (patch) | |
tree | 5914da4cacc8ef869c994eb44a427ec5cd50e3ef /src/nvim/buffer.c | |
parent | 5fe519f78a790abbd15d24f05ce19bed22b07990 (diff) | |
download | rneovim-7fc7f026ad1103b1f6670507cd9cd7a816ae3539.tar.gz rneovim-7fc7f026ad1103b1f6670507cd9cd7a816ae3539.tar.bz2 rneovim-7fc7f026ad1103b1f6670507cd9cd7a816ae3539.zip |
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
Diffstat (limited to 'src/nvim/buffer.c')
-rw-r--r-- | src/nvim/buffer.c | 32 |
1 files changed, 17 insertions, 15 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(®match, name, (colnr_T)0)) match = name; else { |