1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-09 00:11:25 +02:00

users/12100: default to a case-insensitive matcher with NO_CASE_GLOB

This commit is contained in:
Peter Stephenson 2007-10-25 09:00:02 +00:00
parent 9fc8fe1785
commit abdf734483
3 changed files with 21 additions and 1 deletions

View file

@ -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:

View file

@ -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

View file

@ -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))(