summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2007-10-25 09:00:02 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2007-10-25 09:00:02 +0000
commitabdf7344833c13623b433b071f337128890eb063 (patch)
treee4fdea310d0de842ec1195f9861092629acb24a0 /Completion
parent9fc8fe178590acb4407f0b9220ce160c851da037 (diff)
downloadzsh-abdf7344833c13623b433b071f337128890eb063.tar.gz
zsh-abdf7344833c13623b433b071f337128890eb063.tar.xz
zsh-abdf7344833c13623b433b071f337128890eb063.zip
users/12100: default to a case-insensitive matcher with NO_CASE_GLOB
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Unix/Type/_path_files11
1 files changed, 10 insertions, 1 deletions
diff --git a/Completion/Unix/Type/_path_files b/Completion/Unix/Type/_path_files
index f20a941c0..4176005c3 100644
--- a/Completion/Unix/Type/_path_files
+++ b/Completion/Unix/Type/_path_files
@@ -101,7 +101,16 @@ if (( $#ignore )); then
   (( $mopts[(I)-F] )) || mopts=( "$mopts[@]" -F _comp_ignore )
 fi
 
-(( $#matcher )) && mopts=( "$mopts[@]" "$matcher[@]" )
+if [[ $#matcher -eq 0 && -o nocaseglob ]]; then
+  # If globbing is case insensitive and there's no matcher,
+  # do case-insensitive matching.
+  matcher=( -M 'm:{a-zA-Z}={A-Za-z}' )
+fi
+
+if (( $#matcher )); then
+  # Add the current matcher to the options to compadd.
+  mopts=( "$mopts[@]" "$matcher[@]" )
+fi
 
 if zstyle -s ":completion:${curcontext}:" file-sort tmp1; then
   case "$tmp1" in