Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

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@xxxxxxxxxxxxxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author