zsh-workers
 help / color / mirror / code / Atom feed
* Fix for a ZLE bug
@ 1996-04-18 23:02 Zefram
  0 siblings, 0 replies; only message in thread
From: Zefram @ 1996-04-18 23:02 UTC (permalink / raw)
  To: Z Shell workers mailing list

-----BEGIN PGP SIGNED MESSAGE-----

There's been a weird bug in ZLE for a while.  The symptom is that if
one does a vi range command (e.g. cw), and the movement command moves
forward to offset 26 in the buffer, the command is applied to the
entire line instead of just the requested range.  The cause is an error
in the vi range logic.  The patch below fixes it.  I made this patch
with a beta14 patched with the ZLE changes I have already posted, but
it should apply cleanly to straight beta14 and to Zoltan's recent
releases.

Would anyone find it useful if I post all my pending ZLE changes in one
large patch?
      
      Index: Src/zle_vi.c
      *** Src/zle_vi.c	1996/04/16 22:17:21	1.3
      --- Src/zle_vi.c	1996/04/18 16:17:10
      ***************
      *** 236,244 ****
        
            /* get the range the right way round */
            if (cs > t0) {
      ! 	k2 = cs;
        	cs = t0;
      ! 	t0 = k2;
            }
        
            /* Was it a line-oriented move?  In this case, entire lines are taken.  The
      --- 236,244 ----
        
            /* get the range the right way round */
            if (cs > t0) {
      ! 	int tmp = cs;
        	cs = t0;
      ! 	t0 = tmp;
            }
        
            /* Was it a line-oriented move?  In this case, entire lines are taken.  The
      ***************
      *** 246,256 ****
            deal with appropriately.  At this point we just need to make the range
            encompass entire lines. */
            if (zlecmds[k2].flags & ZLE_LINEMOVE) {
      ! 	vilinerange = 1;
      ! 	k2 = findbol();
        	cs = t0;
        	t0 = findeol();
      ! 	cs = k2;
            }
            return t0;
        }
      --- 246,256 ----
            deal with appropriately.  At this point we just need to make the range
            encompass entire lines. */
            if (zlecmds[k2].flags & ZLE_LINEMOVE) {
      ! 	int newcs = findbol();
        	cs = t0;
        	t0 = findeol();
      ! 	cs = newcs;
      ! 	vilinerange = 1;
            }
            return t0;
        }

 -zefram

-----BEGIN PGP SIGNATURE-----
Version: 2.6.i

iQCVAgUBMXbJwnD/+HJTpU/hAQGg3wP/fbEeWcbtuJW9kb6H9ABYTDs2W5D6DTvS
vWdPnAljtvg6EeAf7cteIbY4ClPbfXnvkSYdLKPFQnrhOUeJLkSXRBuSWaPB478b
Khc+9xKjbOAbXHPxHFLLZZAg2r/uPTw+V+VtHn89qngRleu9cPBhs6IfoTSTap69
x0K4Jpuv59w=
=qdz5
-----END PGP SIGNATURE-----



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1996-04-18 23:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-04-18 23:02 Fix for a ZLE bug Zefram

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).