diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | Completion/Unix/Type/_path_files | 11 | ||||
-rw-r--r-- | Doc/Zsh/compsys.yo | 5 |
3 files changed, 21 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog index 3ca6f3f0b..36a957a76 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-10-25 Peter Stephenson <pws@csr.com> + + * users/12100: Completion/Unix/Type/_path_files, + Doc/Zsh/compsys.yo: with NO_CASE_GLOB, use a case-insensitive + matcher if none is in effect. + 2007-10-24 Peter Stephenson <p.w.stephenson@ntlworld.com> * 24018: Doc/Zsh/mod_curses.yo, Src/Modules/curses.c: 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 diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo index 780255e58..04fc6ecfa 100644 --- a/Doc/Zsh/compsys.yo +++ b/Doc/Zsh/compsys.yo @@ -1968,6 +1968,11 @@ quickly reduce the shell's performance. As a rough rule of thumb, one to three strings will give acceptable performance. On the other hand, putting multiple space-separated values into the same string does not have an appreciable impact on performance. + +If there is no current matcher or it is empty, and the option +tt(NO_CASE_GLOB) is in effect, the matching for files is performed +case-insensitively in any case. However, any matcher must +explicitly specify case-insensitive matching if that is required. ) kindex(max-errors, completion style) item(tt(max-errors))( |