From abdf7344833c13623b433b071f337128890eb063 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Thu, 25 Oct 2007 09:00:02 +0000 Subject: users/12100: default to a case-insensitive matcher with NO_CASE_GLOB --- Completion/Unix/Type/_path_files | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Type/_path_files') 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 -- cgit 1.4.1