zsh-workers
 help / color / mirror / code / Atom feed
* completion bugfix
@ 1996-11-15 13:35 Zefram
  0 siblings, 0 replies; only message in thread
From: Zefram @ 1996-11-15 13:35 UTC (permalink / raw)
  To: Z Shell workers mailing list

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


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

only message in thread, other threads:[~1996-11-15 13:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-11-15 13:35 completion bugfix 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).