diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2008-06-08 17:53:53 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2008-06-08 17:53:53 +0000 |
commit | bb68ee8db7971b683fba7dd7bf404186872ba7cf (patch) | |
tree | ce1f5ebe661c12386675eb3ca98521280d521a0b /Completion/compinstall | |
parent | 2dcc8627c9f4be547e6e49c76d45bea70c714a71 (diff) | |
download | zsh-bb68ee8db7971b683fba7dd7bf404186872ba7cf.tar.gz zsh-bb68ee8db7971b683fba7dd7bf404186872ba7cf.tar.xz zsh-bb68ee8db7971b683fba7dd7bf404186872ba7cf.zip |
25138(? mailing list stuck): rewrite of completion matching.
Will one day use multibyte/wide characters, doesn't yet.
Diffstat (limited to 'Completion/compinstall')
-rw-r--r-- | Completion/compinstall | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Completion/compinstall b/Completion/compinstall index 4fc615958..8149a1d55 100644 --- a/Completion/compinstall +++ b/Completion/compinstall @@ -985,8 +985,14 @@ __ci_do_matchers() { for (( eltcnt = 1; eltcnt <= $#mlist; eltcnt++ )); do [[ $mlist[eltcnt] == "+"* ]] && a_or_r[$eltcnt]='+' [[ -z $mlist[$eltcnt] ]] && n_list[$eltcnt]=$eltcnt + # Accept the old form of lower/upper correspondence, but we'll + # output the new one instead. [[ $mlist[$eltcnt] = *"m:{a-z}={A-Z}"* ]] && c_list[$eltcnt]=$eltcnt + [[ $mlist[$eltcnt] = *"m:{[:lower:]}={[:upper:]}"* ]] && + c_list[$eltcnt]=$eltcnt [[ $mlist[$eltcnt] = *"m:{a-zA-Z}={A-Za-z}"* ]] && C_list[$eltcnt]=$eltcnt + [[ $mlist[$eltcnt] = *"m:{[:lower:][:upper:]}={[:upper:][:lower:]}"* ]] && + C_list[$eltcnt]=$eltcnt # For partial word stuff, we use backreferences to find out what # the set of separators was. if [[ $mlist[$eltcnt] = (#b)*"r:|["([^\]]#)"]=*"#" r:|=*"* ]]; then @@ -1105,8 +1111,10 @@ terminators to be matched in this way? (y/n) [n] " # and reconstructing the elements of the matcher array. for (( eltcnt = 1; eltcnt <= 4; eltcnt++ )); do elt= - [[ $c_list[$eltcnt] != ' ' ]] && elt="${elt:+$elt }m:{a-z}={A-Z}" - [[ $C_list[$eltcnt] != ' ' ]] && elt="${elt:+$elt }m:{a-zA-Z}={A-Za-z}" + [[ $c_list[$eltcnt] != ' ' ]] && + elt="${elt:+$elt }m:{[:lower:]}={[:upper:]}" + [[ $C_list[$eltcnt] != ' ' ]] && + elt="${elt:+$elt }m:{[:lower:][:upper:]}={[:upper:][:lower:]}" [[ $p_list[$eltcnt] != ' ' ]] && elt="${elt:+$elt }r:|[${pw_seps[$eltcnt]}]=*${pw_dstar[$eltcnt]}\ r:|=*${pw_dstar[$eltcnt]}" |