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

PATCH: Re: 3.1.7-pre-1: Problem with scrolled completion listings



Bart Schaefer wrote:

> ...
> 
> (in reverse video).  Hit TAB repeatedly (21 times, to be exact) and note
> that the selection disappears, and you're now stuck repeatedly selecting
> the file name that would be visible if only the status line weren't there.
> The status line now says something like
> 
>   Scrolling active: current selection at 62%
> 
> Pressing one of the arrow keys restores sanity.

I forgot to re-calculate the number of the line the mark is on for the 
completion widgets inside menu-selection.

> Aside: Why is "Current position ... Continue?" NOT in reverse video?  Why
> whitespace rather than a colon between "Top" and "Continue" ?  Am I just
> being a foolishly consistent hobgoblin to want these to look similar?

You aren't. I'm pretty sure I wanted to that and then was confused by
the flurry of patches. Maybe I'm beginning to break down...


I would like to hear what you think about this going-back in
completion lists (non-menu-selection) and about the make-listing-look-
like-menu-selection-probably-even-keeping-the-prompt-on-the-line
thing. As opposed to the current should-work-on-almost-every-terminal
version we have now. Or maybe you don't care?

Bye
 Sven

Index: Completion/Core/_main_complete
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Core/_main_complete,v
retrieving revision 1.8
diff -u -r1.8 _main_complete
--- Completion/Core/_main_complete	2000/04/19 06:49:36	1.8
+++ Completion/Core/_main_complete	2000/04/25 12:13:31
@@ -57,13 +57,13 @@
 _last_menu_style=()
 
 zstyle -s ":completion:${curcontext}:default" list-prompt LISTPROMPT ||
-    LISTPROMPT='Current position at %P    Continue? '
+    LISTPROMPT='%SCurrent position at %p: continue? %s'
 if [[ -n "$LISTPROMPT" ]]; then
   zmodload -i zsh/complist
   compstate[list_max]=scroll
 fi
 zstyle -s ":completion:${curcontext}:default" select-prompt SELECTPROMPT ||
-    SELECTPROMPT='%SScrolling active: current selection at %p'
+    SELECTPROMPT='%SScrolling active: current selection at %p%s'
 zstyle -s ":completion:${curcontext}:default" select-scroll SELECTSCROLL ||
     SELECTSCROLL=1
 
Index: Src/Zle/complist.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/complist.c,v
retrieving revision 1.5
diff -u -r1.5 complist.c
--- Src/Zle/complist.c	2000/04/20 11:03:16	1.5
+++ Src/Zle/complist.c	2000/04/25 12:13:33
@@ -1594,6 +1594,20 @@
     mlines = 999999;
     mlbeg = 0;
     for (;;) {
+	if (mline < 0) {
+	    int x, y;
+	    Cmatch **p = mtab;
+
+	    for (y = 0; y < mlines; y++) {
+		for (x = mcols; x; x--, p++)
+		    if (*p && **p && mselect == (**p)->gnum)
+			break;
+		if (x)
+		    break;
+	    }
+	    if (y < mlines)
+		mline = y;
+	}
 	space = lines - nlnct - mhasstat;
 	while (mline < mlbeg)
 	    if ((mlbeg -= step) < 0)
@@ -1999,12 +2013,14 @@
 	    do_menucmp(0);
 	    mselect = (*(minfo.cur))->gnum;
 	    setwish = 1;
+	    mline = -1;
 	    continue;
 	} else if (cmd == Th(z_reversemenucomplete) ||
 		   !strcmp(cmd->nam, "reverse-menu-complete")) {
 	    reversemenucomplete(zlenoargs);
 	    mselect = (*(minfo.cur))->gnum;
 	    setwish = 1;
+	    mline = -1;
 	    continue;
 	} else {
 	    ungetkeycmd();

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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