Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
vi-backward-kill-word fix
- X-seq: zsh-workers 263
- From: Zefram <A.Main@xxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxxx (Z Shell workers mailing list)
- Subject: vi-backward-kill-word fix
- Date: Sun, 23 Jul 1995 05:44:30 +0100 (BST)
-----BEGIN PGP SIGNED MESSAGE-----
The patch below fixes a bug in vi-backward-kill-word, that it would
delete past the beginning of the line, which it shouldn't.
-zefram
*** 1.1 1995/07/21 20:20:54
--- Src/zle_word.c 1995/07/23 04:41:44
***************
*** 248,254 ****
void
vibackwardkillword(void)
{
! int x = cs;
if (mult < 0) {
feep();
--- 248,254 ----
void
vibackwardkillword(void)
{
! int x = cs, lim = (viinsbegin > findbol()) ? viinsbegin : findbol();
if (mult < 0) {
feep();
***************
*** 256,276 ****
}
/* this taken from "vibackwardword" */
while (mult--) {
! while ((x > viinsbegin) && iblank(line[x - 1]))
x--;
if (iident(line[x - 1]))
! while ((x > viinsbegin) && iident(line[x - 1]))
x--;
else
! while ((x > viinsbegin) && !iident(line[x - 1]) && !iblank(line[x - 1]))
x--;
}
- /*
- while (mult--) {
- while ( (x > viinsbegin) && (iwordsep(line[x-1]))) x--;
- while ( (x > viinsbegin) && (!iwordsep(line[x-1]))) x--;
- }
- */
backkill(cs - x, 1);
}
--- 256,270 ----
}
/* this taken from "vibackwardword" */
while (mult--) {
! while ((x > lim) && iblank(line[x - 1]))
x--;
if (iident(line[x - 1]))
! while ((x > lim) && iident(line[x - 1]))
x--;
else
! while ((x > lim) && !iident(line[x - 1]) && !iblank(line[x - 1]))
x--;
}
backkill(cs - x, 1);
}
-----BEGIN PGP SIGNATURE-----
Version: 2.6.i
iQBVAgUBMBHTnGWJ8JfKi+e9AQH/hQH/V1o8c8pALz43MtG2LG+pPwBiaNzUA0lE
V0+YKymLQqDBvWsdsxFaFwu54RG06QjqKt2DmO1OcoF7NGOp96BkqQ==
=DVBV
-----END PGP SIGNATURE-----
Messages sorted by:
Reverse Date,
Date,
Thread,
Author