From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1656 invoked from network); 12 Jul 2000 09:23:44 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 12 Jul 2000 09:23:44 -0000 Received: (qmail 27220 invoked by alias); 12 Jul 2000 09:23:34 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 12226 Received: (qmail 27213 invoked from network); 12 Jul 2000 09:23:33 -0000 Date: Wed, 12 Jul 2000 11:23:27 +0200 (MET DST) Message-Id: <200007120923.LAA20826@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Peter Stephenson's message of Tue, 11 Jul 2000 16:29:06 +0100 Subject: PATCH: Re: long completion selections and listings Peter Stephenson wrote: > According to the manual, select-prompt has a default when you used > scrolling with menus. It doesn't show up for me --- I had to set it > explicitly. (If I remember right, I didn't put it in compinstall because > there was already a sensible default.) You get the default when setting select-prompt to the empty string and that works for me. > Another thing, maybe I misunderstood somewhere, but I have > zstyle ':completion:*' menu 'select=long' 'select=5' > Since I don't have select=long-list, I wouldn't expect long listings to > switch automatically to menu selection, but at the moment they do. > Lists which do fit on the screen don't. I hope you meant this: it shouldn't start menu selection if not starting menu completion. Right. Bye Sven Index: Completion/Core/_main_complete =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Core/_main_complete,v retrieving revision 1.35 diff -u -r1.35 _main_complete --- Completion/Core/_main_complete 2000/07/03 08:05:27 1.35 +++ Completion/Core/_main_complete 2000/07/12 09:22:39 @@ -175,7 +175,7 @@ -n "$_menu_style[(r)(yes|true|on|1)=long-list]" ) ]]; then compstate[insert]=menu elif [[ "$compstate[insert]" = "$_saved_insert" ]]; then - if [[ -n "$_menu_style[(r)select=long]" && tmp -gt LINES ]]; then + if [[ -n "$_menu_style[(r)(yes|true|1|on)=long]" && tmp -gt LINES ]]; then compstate[insert]=menu else sel=( "${(@M)_menu_style:#(yes|true|1|on)*}" ) @@ -183,11 +183,13 @@ if (( $#sel )); then min=9999999 for i in "$sel[@]"; do - if [[ "$i" = *\=* ]]; then + if [[ "$i" = *\=[0-9]* ]]; then num="${i#*\=}" [[ num -lt 0 ]] && num=0 - else - num=$nm + elif [[ "$i" != *\=* ]]; then + num=0 + else + num=9999999 fi [[ num -lt min ]] && min="$num" @@ -199,11 +201,13 @@ if (( $#sel )); then max=9999999 for i in "$sel[@]"; do - if [[ "$i" = *\=* ]]; then + if [[ "$i" = *\=[0-9]* ]]; then num="${i#*\=}" [[ num -lt 0 ]] && num=0 - else + elif [[ "$i" != *\=* ]]; then num=0 + else + num=9999999 fi [[ num -lt max ]] && max="$num" @@ -229,20 +233,22 @@ elif [[ -n "$_menu_style[(r)select=long*]" ]]; then if [[ tmp -gt LINES ]]; then zmodload -i zsh/complist - MENUSELECT=0 + MENUSELECT=00 fi fi - if [[ "$MENUSELECT" != 0 ]]; then + if [[ "$MENUSELECT" != 00 ]]; then sel=( "${(@M)_menu_style:#select*}" ) if (( $#sel )); then min=9999999 for i in "$sel[@]"; do - if [[ "$i" = *\=* ]]; then + if [[ "$i" = *\=[0-9]* ]]; then num="${i#*\=}" [[ num -lt 0 ]] && num=0 - else + elif [[ "$i" != *\=* ]]; then num=0 + else + num=9999999 fi [[ num -lt min ]] && min="$num" -- Sven Wischnowsky wischnow@informatik.hu-berlin.de