zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: Re: Menu selection movement weirdnesses
@ 2000-05-25 11:31 Sven Wischnowsky
  2000-05-25 14:45 ` Peter Stephenson
  0 siblings, 1 reply; 2+ messages in thread
From: Sven Wischnowsky @ 2000-05-25 11:31 UTC (permalink / raw)
  To: zsh-workers


Peter Stephenson wrote:

> I think I'm up to date, I know there was a complist patch this morning...

That's old behaviour, comes from the when-wrapping-go-{left,right,...}.

> I have a completion list with 4 columns by 10 rows... that's probably not
> important, what probably is, is that there is a gap at the bottom right,
> i.e. there are 39 entries.  With menu selection, various weird movements
> seem to happen:
> 
> - going up from the top of column four (the last) goes to the bottom of
>   column two, not three;

That's because it was first going up, placing the cursor on the last
item of the third column, then it tested if it had wrapped araound and 
because it had, went left.

> - going left from the bottom of column one goes to the previous line but in
>   column three, not column four.

Similar to the first case.

> - going down from the end of column four (the second last line, with
>   nothing underneath) goes to the last entry in column three.  It's hard
>   to say whether it should go to the top of column four or column one, but
>   I don't think the current behaviour is right.  I suppose it should mirror
>   the behaviour of moving up from the top of column one and move to the top
>   of column four, given that the current implementation never does both
>   a vertical and horizontal wrap in the same move.

I disagree here, having worked quite hard to achieve this. It's more
like moving in emacs: it remembers the column it would like to be in,
then you move down and this is really a line-movement, so it goes to
the next line and places the cursor as near to the last column it was
in as it can. If you continue moving down, so that the cursor moves
into the first line, the cursor is placed in the last column
again. And that only because of the aforementioned change, it did that 
before, because it remembers it once was in that column.

So, I don't want to change it, but if enough people come shouting at
me, I may do that, probably using other widgets for the different
behaviour. It's the decision between line- and column-oriented
movement, I think. But please note that the column-orientation you
expect can't really be achieved as soon as there are multiple groups
with different numbers of columns (that's the reason why I wrote this
original-column-memory).


Bye
 Sven

Index: Src/Zle/complist.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/complist.c,v
retrieving revision 1.19
diff -u -r1.19 complist.c
--- Src/Zle/complist.c	2000/05/25 07:58:44	1.19
+++ Src/Zle/complist.c	2000/05/25 11:31:11
@@ -1949,8 +1949,12 @@
 		    continue;
 	    } while (!*p || *p == mtexpl);
 
-	    if (wrap == 1)
-		goto left;
+	    if (wrap == 1) {
+		if (mcol == wishcol)
+		    goto left;
+
+		wishcol = mcol;
+	    }
 	} else if (cmd == Th(z_emacsforwardword) ||
 		   cmd == Th(z_viforwardword) ||
 		   cmd == Th(z_viforwardwordend) ||
@@ -2104,8 +2108,12 @@
 	    } while (!*p || *p == mtexpl || (mcol != omcol && *p == *op));
 	    wishcol = mcol;
 
-	    if (wrap == 2)
+	    if (wrap == 2) {
+		p += mcols - 1 - mcol;
+		wishcol = mcol = mcols - 1;
+		adjust_mcol(wishcol, &p, NULL);
 		goto up;
+	    }
 	} else if (cmd == Th(z_beginningofbufferorhistory) ||
 		   cmd == Th(z_beginningofline) ||
 		   cmd == Th(z_beginningoflinehist) ||

--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: PATCH: Re: Menu selection movement weirdnesses
  2000-05-25 11:31 PATCH: Re: Menu selection movement weirdnesses Sven Wischnowsky
@ 2000-05-25 14:45 ` Peter Stephenson
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Stephenson @ 2000-05-25 14:45 UTC (permalink / raw)
  To: Zsh hackers list

Sven wrote:

> > - going down from the end of column four (the second last line, with
> >   nothing underneath) goes to the last entry in column three.
>
> But please note that the column-orientation you
> expect can't really be achieved as soon as there are multiple groups
> with different numbers of columns (that's the reason why I wrote this
> original-column-memory).

Yes, you're right, the way you've got it will be considerably better if you
have groups with different formats.

-- 
Peter Stephenson <pws@cambridgesiliconradio.com>
Cambridge Silicon Radio, Unit 300, Science Park, Milton Road,
Cambridge, CB4 0XL, UK                          Tel: +44 (0)1223 392070


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-05-25 14:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-05-25 11:31 PATCH: Re: Menu selection movement weirdnesses Sven Wischnowsky
2000-05-25 14:45 ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).