Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bug in ZSH's vi emulation
- X-seq: zsh-workers 39813
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: Bug in ZSH's vi emulation
- Date: Wed, 2 Nov 2016 21:12:43 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=okVP1KcQdfoTtJtFg9yG11R64lVoObCBWwWka2pf60A=; b=Arkj/P+EmpvTTkVJT6ERXV1K5cEh8NP2RppaHgqPEGwhkQmun+/jwlaAr1rYLcTzZz YsD8/pdZzKw6bh4/3+y+dmruqWylwAZDCKSftyZvrzIKzclle1cKP5aFeQadxabyQfP9 TFlsesYRGmxc21L3scyC1DM7t9XfChTaJUMkiUOTds0ea9C2xJlPKMfbEDQ7W/6zR8yj dn0y2tsI0pWxzCnRA4Zt1NTispNOrMjfzQuBZ7Ct9ORykZf4maV+8R3/c3WrIPhg1cBD BmUItYwT1UM2QJYQCSdOlXv9srrZVCR4d9/h0l3N3oqOUmyV7XhGTmvEbB0GjB3Hal2x hjqg==
- In-reply-to: <11719.1478105483@hydra.kiddle.eu>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20161005080921.GB26647@raspi> <161005101938.ZM12590@torch.brasslantern.com> <20161102045925.GA6763@fujitsu.shahaf.local2> <11719.1478105483@hydra.kiddle.eu>
On Nov 2, 5:51pm, Oliver Kiddle wrote:
}
} We've also got a separate issue of only lastchar being stuffed into
} vichgbuf so repeating, e.g. gU doesn't work. Why is keybuflen only
} 1 in startvichange? That, along with what the general point of lastchar
} is, has me fairly puzzled.
It's because of getkeymapcmd():
if(lastlen != keybuflen) {
unmetafy(keybuf + lastlen, &keybuflen); <-- here
ungetbytes(keybuf+lastlen, keybuflen);
if(vichgflag)
vichgbufptr -= keybuflen;
keybuf[lastlen] = 0;
}
Seems like it ought to do the following? Or else use a temporary instead
of stomping on keybuflen.
diff --git a/Src/Zle/zle_keymap.c b/Src/Zle/zle_keymap.c
index 3db4207..b5244b5 100644
--- a/Src/Zle/zle_keymap.c
+++ b/Src/Zle/zle_keymap.c
@@ -1622,7 +1622,7 @@ getkeymapcmd(Keymap km, Thingy *funcp, char **strp)
ungetbytes(keybuf+lastlen, keybuflen);
if(vichgflag)
vichgbufptr -= keybuflen;
- keybuf[lastlen] = 0;
+ keybuf[keybuflen = lastlen] = 0;
}
*funcp = func;
*strp = str;
Messages sorted by:
Reverse Date,
Date,
Thread,
Author