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

Re: Some problems with list scrolling and menu selection



Andrej Borsenkow wrote:

> 1. The default for starting menu selection is less than user friendly.
> Normally, menu selection is started on the second TAB (assuming more or
> less standard config; zstyle output follows). With list scrolling TAB
> first pages to the end of list and only then starts selection. I think,
> TAB should behave the same way here as well. Probably, "least surprise"
> for user would be, when TAB in list scrolling jumps to the first shown
> match (and not to the very first item in the list). Consider usage - you
> first find needed page and then select needed item there.

Hm, `less than user friendly'? See also below: the reference to
10816. Currently, the listing code is intentionally separated from the 
menu-selection code to make the listing code (including scrolling)
work on (almost) every terminal.

For the jump-into-menu-selection-now: I'm not sure if this is really
more user friendly. And remember, that any widget without special
meaning stops listing and is executed right away, so:

  bindkey -M listscroll '^I' .menu-select

Is that enough? If we document it?

> 2. There are problems with scrolling back in menu selection. Try GNU
> diff (with verbose on). I did it on dtterm from TriTeal TED 4.2 with
> 24x80 size.
>
> ...
> 
> Note, that the line just under the prompt disappears.

A nasty off-by-one error when displaying matches with line-oriented
display strings. You probably guessed that.

> 3. Is it possible to retain current Zle line (prompt) at the top when
> listing completions? Like menu selection does it. I find it somewhat
> confusing as it is.
> 
> 4. And, of course, scrolling back in completion listing :-)

Have you read 10816?

Bye
 Sven

Index: Src/Zle/complist.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/complist.c,v
retrieving revision 1.4
diff -u -r1.4 complist.c
--- Src/Zle/complist.c	2000/04/19 06:49:37	1.4
+++ Src/Zle/complist.c	2000/04/20 10:53:45
@@ -1122,21 +1122,12 @@
 		    n = lastn;
 		    nl = lastnl;
 		    lastused = 1;
+		    pnl = 0;
 		} else
 		    p = g->matches;
 
 		for (; (m = *p); p++) {
 		    if (m->disp && (m->flags & CMF_DISPLINE)) {
-			if (!lasttype && ml >= mlbeg) {
-			    lasttype = 2;
-			    lastg = g;
-			    lastbeg = mlbeg;
-			    lastml = ml;
-			    lastp = p;
-			    lastn = n;
-			    lastnl = nl;
-			    lastused = 1;
-			}
 			if (pnl) {
 			    if (dolistnl(ml) && compprintnl(ml))
 				goto end;
@@ -1147,6 +1138,16 @@
 				if (tccan(TCCLEAREOD))
 				    tcout(TCCLEAREOD);
 			    }
+			}
+			if (!lasttype && ml >= mlbeg) {
+			    lasttype = 2;
+			    lastg = g;
+			    lastbeg = mlbeg;
+			    lastml = ml;
+			    lastp = p;
+			    lastn = n;
+			    lastnl = nl;
+			    lastused = 1;
 			}
 			if (mfirstl < 0)
 			    mfirstl = ml;

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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