From 35b2633ad941966f5fca07b625a594a5b68c0fdb Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Mon, 15 Nov 1999 12:01:46 +0000 Subject: manual/8639 --- Completion/Core/_oldlist | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'Completion/Core/_oldlist') diff --git a/Completion/Core/_oldlist b/Completion/Core/_oldlist index 2efc08119..2408613da 100644 --- a/Completion/Core/_oldlist +++ b/Completion/Core/_oldlist @@ -1,18 +1,26 @@ #autoload +local curcontext="$curcontext" list menu + +# Probably set initial context. + +[[ -z "$curcontext" ]] && curcontext=':oldlist' + +_style -s '' list list +_style -s '' menu menu + # If this is a listing widget and there is already an old list, -# and either the compconfig key oldlist_list is `always', or it is not `never' +# and either the style :oldlist:list is `always', or it is not `never' # and the list is not already shown, then use the existing list for listing # (even if it was generated by another widget). # Do this also if there is an old list and it was generated by the # completer named by the oldlist_list key. -if [[ -n $compstate[old_list] && $compconfig[oldlist_list] != never ]]; then - if [[ $WIDGET = *list* && - ( $compconfig[oldlist_list] = always || - $compstate[old_list] != shown ) ]]; then + +if [[ -n $compstate[old_list] && $list != never ]]; then + if [[ $WIDGET = *list* && ( $list = always || $list != shown ) ]]; then compstate[old_list]=keep return 0 - elif [[ $compconfig[oldlist_list] = *${_lastcomp[completer]}* ]]; then + elif [[ $list = *${_lastcomp[completer]}* ]]; then [[ "$_lastcomp[insert]" = unambig* ]] && compstate[to_end]=single compstate[old_list]=keep if [[ -o automenu ]]; then @@ -25,16 +33,16 @@ if [[ -n $compstate[old_list] && $compconfig[oldlist_list] != never ]]; then fi # If this is a completion widget, and we have a completion inserted already, -# and the compconfig key oldlist_menu is not never, then we cycle through the +# and the style :oldlist:menu is not never, then we cycle through the # existing list (even if it was generated by another widget). -if [[ $compconfig[oldlist_menu] = verbose && +if [[ $menu = verbose && $LASTWIDGET = _verbose_list && $WIDGET != _verbose_list && -z $compstate[old_insert] && -n $compstate[old_list] ]]; then compstate[old_list]=keep elif [[ $WIDGET = *complete(|-prefix|-word) && - $compconfig[oldlist_menu] != (never|verbose) ]]; then + $menu != (never|verbose) ]]; then if [[ -n $compstate[old_insert] ]]; then compstate[old_list]=keep if [[ $WIDGET = *reverse* ]]; then -- cgit 1.4.1