zsh-workers
 help / color / mirror / code / Atom feed
* vi-goto-column
@ 1997-01-14 12:40 Peter Stephenson
  1997-01-14 14:05 ` vi-goto-column Zoltan Hidvegi
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Stephenson @ 1997-01-14 12:40 UTC (permalink / raw)
  To: Zsh hackers list

The behaviour of vi-goto-column has changed: it now won't go to the
last column, i.e. the space after all the characters.  This was
presumably introduced by some mistaken analogy with vi, where there is
no space at the end of the line after the last inserted character.  In
zsh there is (remember, ^[| can be called from emacs mode) and there
is no reason why the shell shouldn't go to it.  The change has already
caused problems here.  The excuse `we randomly changed this because we
thought it would be nice if it did something else' is not widely
accepted (to put it mildly) by users and system managers.

% ~
   ^ typing ^[2^[| here goes to the first character instead of staying put.

-- 
Peter Stephenson <pws@ifh.de>       Tel: +49 33762 77366
WWW:  http://www.ifh.de/~pws/       Fax: +49 33762 77413
Deutsches Elektronen-Synchrotron --- Institut fuer Hochenergiephysik Zeuthen
DESY-IfH, 15735 Zeuthen, Germany.


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

* Re: vi-goto-column
  1997-01-14 12:40 vi-goto-column Peter Stephenson
@ 1997-01-14 14:05 ` Zoltan Hidvegi
  1997-01-14 14:24   ` vi-goto-column Zefram
  0 siblings, 1 reply; 4+ messages in thread
From: Zoltan Hidvegi @ 1997-01-14 14:05 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: zsh-workers

Peter Stephenson wrote:
> The behaviour of vi-goto-column has changed: it now won't go to the
> last column, i.e. the space after all the characters.  This was
> presumably introduced by some mistaken analogy with vi, where there is
> no space at the end of the line after the last inserted character.  In

In vi you cannot put the cursor after the last character and it does not
matter wether it is a space or not.  Zsh just does the same.

The patch below will probably does what you want but vi fans may oppose
this patch.  POSIX.2 upe specifies the requirements for vi mode, but
unfortunately I do not have this document so I do not know how this should
behave.  Bash behaves like zsh so I think the current behaviour
(ie. without the patch below) is correct.

Zoltan


*** Src/Zle/zle_move.c	1997/01/12 00:46:43	3.1.1.5
--- Src/Zle/zle_move.c	1997/01/14 13:46:03
***************
*** 181,188 ****
  	cs = x + zmult;
      else
  	cs = y + zmult;
!     if (cs >= y)
! 	cs = y - 1;
      if (cs < x)
  	cs = x;
  }
--- 181,188 ----
  	cs = x + zmult;
      else
  	cs = y + zmult;
!     if (cs > y)
! 	cs = y;
      if (cs < x)
  	cs = x;
  }


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

* Re: vi-goto-column
  1997-01-14 14:05 ` vi-goto-column Zoltan Hidvegi
@ 1997-01-14 14:24   ` Zefram
  1997-01-15  8:34     ` vi-goto-column Peter Stephenson
  0 siblings, 1 reply; 4+ messages in thread
From: Zefram @ 1997-01-14 14:24 UTC (permalink / raw)
  To: Zoltan Hidvegi; +Cc: Z Shell workers mailing list

Zoltan Hidvegi wrote:
>The patch below will probably does what you want but vi fans may oppose
>this patch.  POSIX.2 upe specifies the requirements for vi mode, but
>unfortunately I do not have this document so I do not know how this should
>behave.  Bash behaves like zsh so I think the current behaviour
>(ie. without the patch below) is correct.

This patch is correct.  After any command has been executed, ZLE will
move the cursor back one column if it is at the very end of a line in
vi command mode, so for vi users the visible behaviour is not changed
by this patch.

-zefram


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

* Re: vi-goto-column
  1997-01-14 14:24   ` vi-goto-column Zefram
@ 1997-01-15  8:34     ` Peter Stephenson
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Stephenson @ 1997-01-15  8:34 UTC (permalink / raw)
  To: Zsh hackers list

Zefram wrote:
> This patch is correct.  After any command has been executed, ZLE will
> move the cursor back one column if it is at the very end of a line in
> vi command mode, so for vi users the visible behaviour is not changed
> by this patch.

Thanks, this is exactly what I was hoping for.  I hope this can go in
whether it happens to agree with bash in emacs mode or not --- most of the
comments about zsh (which is widely used here) I get are about little
things like this which have changed between versions but which can still
be a big annoyance.  (The institute is just switching from 2.5 to 3.0,
so don't be surprised if there are more.)

-- 
Peter Stephenson <pws@ifh.de>       Tel: +49 33762 77366
WWW:  http://www.ifh.de/~pws/       Fax: +49 33762 77413
Deutsches Elektronen-Synchrotron --- Institut fuer Hochenergiephysik Zeuthen
DESY-IfH, 15735 Zeuthen, Germany.


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

end of thread, other threads:[~1997-01-15  8:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-01-14 12:40 vi-goto-column Peter Stephenson
1997-01-14 14:05 ` vi-goto-column Zoltan Hidvegi
1997-01-14 14:24   ` vi-goto-column Zefram
1997-01-15  8:34     ` vi-goto-column 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).