From bb68ee8db7971b683fba7dd7bf404186872ba7cf Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Sun, 8 Jun 2008 17:53:53 +0000 Subject: 25138(? mailing list stuck): rewrite of completion matching. Will one day use multibyte/wide characters, doesn't yet. --- Completion/compinstall | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'Completion/compinstall') 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]}" -- cgit 1.4.1