From 0ddb4fb835d685b5dc71dadc08d5758a28b99439 Mon Sep 17 00:00:00 2001 From: Sven Wischnowsky Date: Mon, 3 Jul 2000 08:05:27 +0000 Subject: change format style with warnings tag, don't add descriptions as matches; make a-a-i-n-h in menu selection work even without matches (12134) --- Completion/Core/_main_complete | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) (limited to 'Completion') diff --git a/Completion/Core/_main_complete b/Completion/Core/_main_complete index 705208715..8d77bbd2e 100644 --- a/Completion/Core/_main_complete +++ b/Completion/Core/_main_complete @@ -25,7 +25,7 @@ setopt localtraps noerrexit ; trap - ZERR local func funcs ret=1 tmp _compskip format nm call match min max i num\ _completers _completer _completer_num curtag _comp_force_list \ - _matchers _matcher _matcher_num _comp_tags _comp_mesg \ + _matchers _matcher _matcher_num _comp_tags _comp_mesg mesg str \ context state line opt_args val_args curcontext="$curcontext" \ _last_nmatches=-1 _last_menu_style _def_menu_style _menu_style sel \ _saved_exact="${compstate[exact]}" \ @@ -266,23 +266,17 @@ elif [[ nm -eq 0 && compstate[list]='list force' compstate[insert]='' - if [[ "$format" = *%d* ]]; then - local str mesg + tmp=( "\`${(@)^_lastdescr:#}'" ) - _lastdescr=( "\`${(@)^_lastdescr:#}'" ) + case $#tmp in + 1) str="$tmp[1]";; + 2) str="$tmp[1] or $tmp[2]";; + *) str="${(j:, :)tmp[1,-2]}, or $tmp[-1]";; + esac - case $#_lastdescr in - 1) str="$_lastdescr[1]";; - 2) str="$_lastdescr[1] or $_lastdescr[2]";; - *) str="${(j:, :)_lastdescr[1,-2]}, or $_lastdescr[-1]";; - esac - - zformat -f mesg "$format" "d:$str" - compadd -UX "$mesg" -n - '' - else - _setup warnings - compadd -UQX "$format" -V warnings - "${(@)_lastdescr:#}" - fi + _setup warnings + zformat -f mesg "$format" "d:$str" "D:${(F)${(@)_lastdescr:#}}" + compadd -x "$mesg" fi [[ "$_comp_force_list" = always || -- cgit 1.4.1