zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: PATCH: Re: Menu selection movement weirdnesses
Date: Thu, 25 May 2000 13:31:38 +0200 (MET DST)	[thread overview]
Message-ID: <200005251131.NAA02378@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Peter Stephenson's message of Thu, 25 May 2000 11:30:34 +0100


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


             reply	other threads:[~2000-05-25 11:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-05-25 11:31 Sven Wischnowsky [this message]
2000-05-25 14:45 ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200005251131.NAA02378@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).