zsh-workers
 help / color / mirror / code / Atom feed
From: Zefram <A.Main@dcs.warwick.ac.uk>
To: zsh-workers@math.gatech.edu (Z Shell workers mailing list)
Subject: Fix for a ZLE bug
Date: Fri, 19 Apr 1996 00:02:08 +0100 (BST)	[thread overview]
Message-ID: <29003.199604182302@stone.dcs.warwick.ac.uk> (raw)

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



                 reply	other threads:[~1996-04-18 23:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=29003.199604182302@stone.dcs.warwick.ac.uk \
    --to=a.main@dcs.warwick.ac.uk \
    --cc=zsh-workers@math.gatech.edu \
    /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).