From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17224 invoked from network); 12 Apr 2000 09:27:56 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 12 Apr 2000 09:27:56 -0000 Received: (qmail 25817 invoked by alias); 12 Apr 2000 09:27:46 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10691 Received: (qmail 25789 invoked from network); 12 Apr 2000 09:27:42 -0000 Date: Wed, 12 Apr 2000 11:27:31 +0200 (MET DST) Message-Id: <200004120927.LAA07668@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: "Bart Schaefer"'s message of Tue, 11 Apr 2000 16:21:58 +0000 Subject: PATCH: Re: Time for an obscure completion question Bart Schaefer wrote: > ... > > This second one still happens to me. I've set a few more styles; what I > get now is: > > zagzig[72] cd *at/ba > zagzig[72] cd foodatthe/Bar/ > Completing `local directories', `directories in cdpath', or `corrections' > > There are no completions beneath the verbose output there. That's a result of: zstyle ':completion:*' format 'Completing %d' it makes it be used for warnings, too (warnings is what you get when there are no matches). > At this point > if I hit TAB a third time, "foodatthe/Bar/" becomes " ". And this is our frien _oldlist again, inserting the dummy match that was added to display the warning. I'm not completely happy with the test in _oldlist... Bye Sven Index: Completion/Core/_main_complete =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Core/_main_complete,v retrieving revision 1.5 diff -u -r1.5 _main_complete --- Completion/Core/_main_complete 2000/04/07 08:14:07 1.5 +++ Completion/Core/_main_complete 2000/04/12 09:25:20 @@ -19,7 +19,7 @@ setopt localoptions nullglob rcexpandparam extendedglob unsetopt markdirs globsubst shwordsplit nounset ksharrays -local func funcs ret=1 tmp _compskip format \ +local func funcs ret=1 tmp _compskip format nm \ _completers _completer _completer_num curtag \ _matchers _matcher _matcher_num _comp_tags \ context state line opt_args val_args curcontext="$curcontext" \ @@ -105,8 +105,9 @@ done curcontext="${curcontext/:[^:]#:/::}" +nm=$compstate[nmatches] -if [[ $compstate[old_list] = keep || $compstate[nmatches] -gt 1 ]]; then +if [[ $compstate[old_list] = keep || nm -gt 1 ]]; then [[ _last_nmatches -ge 0 && _last_nmatches -ne $compstate[nmatches] ]] && _menu_style=( "$_last_menu_style[@]" "$_menu_style[@]" ) @@ -160,7 +161,7 @@ fi fi fi -elif [[ $compstate[nmatches] -eq 0 && +elif [[ nm -eq 0 && $#_lastdescr -ne 0 && $compstate[old_list] != keep ]] && zstyle -s ":completion:${curcontext}:warnings" format format; then @@ -195,6 +196,7 @@ done _lastcomp=( "${(@kv)compstate}" ) +_lastcomp[nmatches]=$nm _lastcomp[completer]="$_completer" _lastcomp[prefix]="$PREFIX" _lastcomp[suffix]="$SUFFIX" Index: Completion/Core/_oldlist =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Core/_oldlist,v retrieving revision 1.4 diff -u -r1.4 _oldlist --- Completion/Core/_oldlist 2000/04/11 10:42:15 1.4 +++ Completion/Core/_oldlist 2000/04/12 09:25:20 @@ -35,6 +35,7 @@ # existing list (even if it was generated by another widget). if [[ -z $compstate[old_insert] && -n $compstate[old_list] && + ( $_lastcomp[nmatches] -ne 0 || $WIDGET != $LASTWIDGET ) && $LASTWIDGET != _complete_help && $WIDGET != _complete_help ]]; then compstate[old_list]=keep return 0 -- Sven Wischnowsky wischnow@informatik.hu-berlin.de