zsh-workers
 help / color / mirror / code / Atom feed
From: Zefram <zefram@dcs.warwick.ac.uk>
To: zsh-workers@math.gatech.edu (Z Shell workers mailing list)
Subject: completion bugfix
Date: Fri, 15 Nov 1996 13:35:03 +0000 (GMT)	[thread overview]
Message-ID: <6256.199611151335@stone.dcs.warwick.ac.uk> (raw)

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

There's a bug in completion that can cause the cursor to be moved one
character before the start of the word being completed.  At the beginning
of the buffer, this can cause a crash.  Try:

% ;""

Put the cursor on the first quote, and press <tab>.  The cursor moves
before the semicolon.

The following patch fixes this bug.  I *think* that's all it does; the
old code *looks* wrong, but the logic in that function is quite opaque
so I'm not 100% certain.  If anyone knows better, please say so.

 -zefram

      Index: Src/zle_tricky.c
      ===================================================================
      RCS file: /home/zefram/usr/cvsroot/zsh/Src/zle_tricky.c,v
      retrieving revision 1.45
      diff -c -r1.45 zle_tricky.c
      *** zle_tricky.c	1996/11/09 13:29:17	1.45
      --- zle_tricky.c	1996/11/15 02:29:14
      ***************
      *** 1103,1109 ****
        			cs = i;
        			foredel(1);
        			chuck(tt--);
      ! 			if ((cs = ocs) >= i--)
        			    cs--;
        			we--;
        		    }
      --- 1103,1109 ----
        			cs = i;
        			foredel(1);
        			chuck(tt--);
      ! 			if ((cs = ocs) > i--)
        			    cs--;
        			we--;
        		    }

-----BEGIN PGP SIGNATURE-----
Version: 2.6.2

iQCVAwUBMovW5XD/+HJTpU/hAQHkrgP/cANoQu2HZBBjGC6XXrsvHotSi9c3/0PG
MLJTWYaxEAoBvhrZp33N8IFvH9fBE1vmXbC8WY2/CVVjoqfh569COzrGNEcUic0P
LOiqh2NY0sn+lFf/Fqvp5HkbRR8p9sbyPS/PVDC9VuB64FMpO7SPPZID0YIPVa4j
pf/V0z1m7uw=
=tsaL
-----END PGP SIGNATURE-----


                 reply	other threads:[~1996-11-15 13:38 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=6256.199611151335@stone.dcs.warwick.ac.uk \
    --to=zefram@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).