From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: zsh-workers-request@euclid.skiles.gatech.edu Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by coral.primenet.com.au (8.7.6/8.7.3) with ESMTP id AAA02428 for ; Sat, 16 Nov 1996 00:38:38 +1100 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id IAA16889; Fri, 15 Nov 1996 08:35:48 -0500 (EST) Resent-Date: Fri, 15 Nov 1996 08:35:48 -0500 (EST) From: Zefram Message-Id: <6256.199611151335@stone.dcs.warwick.ac.uk> Subject: completion bugfix To: zsh-workers@math.gatech.edu (Z Shell workers mailing list) Date: Fri, 15 Nov 1996 13:35:03 +0000 (GMT) X-Patch: 123 X-Loop: zefram@dcs.warwick.ac.uk X-Stardate: [-31]8427.83 X-US-Congress: Moronic fuckers Content-Type: text Resent-Message-ID: <"UYv7t2.0.p74.p67Zo"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/2415 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu -----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 . 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-----