From 8e2fa4d9b2196e8f3a199cc22400ba35bcb21556 Mon Sep 17 00:00:00 2001 From: Sven Wischnowsky Date: Wed, 12 Jul 2000 09:25:18 +0000 Subject: don't start menu selection with only select=long (12226) --- Completion/Core/_main_complete | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'Completion') diff --git a/Completion/Core/_main_complete b/Completion/Core/_main_complete index 8d77bbd2e..707b48d72 100644 --- a/Completion/Core/_main_complete +++ b/Completion/Core/_main_complete @@ -175,7 +175,7 @@ if [[ $compstate[old_list] = keep || nm -gt 1 ]]; then -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 [[ $compstate[old_list] = keep || nm -gt 1 ]]; then 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 [[ $compstate[old_list] = keep || nm -gt 1 ]]; then 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 @@ if [[ $compstate[old_list] = keep || nm -gt 1 ]]; then 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" -- cgit 1.4.1