aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-07-18 10:51:51 +1200
committerTom Ryder <tom@sanctum.geek.nz>2018-07-18 10:51:51 +1200
commitc623461719fabdc39bba69d205aca2e2bec4b531 (patch)
treea3794fcfc19102253adeb10bad30e85fee4a9c0d
parent5e9844647d7e15e181321f3f45f40769b1d91d01 (diff)
downloaddotfiles-c623461719fabdc39bba69d205aca2e2bec4b531.tar.gz
dotfiles-c623461719fabdc39bba69d205aca2e2bec4b531.zip
Only add uppercase 'wildignore' if it matters
-rw-r--r--vim/plugin/wildignore.vim15
1 files changed, 9 insertions, 6 deletions
diff --git a/vim/plugin/wildignore.vim b/vim/plugin/wildignore.vim
index b87b62b1..b10eaa01 100644
--- a/vim/plugin/wildignore.vim
+++ b/vim/plugin/wildignore.vim
@@ -154,12 +154,15 @@ function! s:Wildignore() abort
\,'*.swp'
\ ]
- " For any that had lowercase letters, add their uppercase analogues
- for l:ignore in l:ignores
- if l:ignore =~# '\l'
- call add(l:ignores, toupper(l:ignore))
- endif
- endfor
+ " If on a system where case matters for filenames, for any that had
+ " lowercase letters, add their uppercase analogues
+ if has('fname_case')
+ for l:ignore in l:ignores
+ if l:ignore =~# '\l'
+ call add(l:ignores, toupper(l:ignore))
+ endif
+ endfor
+ endif
" Return the completed setting
return join(l:ignores, ',')