Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Bug in ZSH's vi emulation

On Wed, 02 Nov 2016 17:51:23 +0100
Oliver Kiddle <okiddle@xxxxxxxxxxx> 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.

The thing that gets stuffed into vichgbuf[0] in startvichange() is the
last byte of the binding that caused the change to start, not the range
of the change.  So if you issue "c" then the "c" goes into the buffer
here and the target gets handled later.  I haven't traced it further
than that, but this would only screw up with atypical bindings for
vi-change, vi-delete, etc. Presumably extracting the full set of bytes
for the command would work.

This wouldn't work with a multibyte binding, for example, e.g. if you
had ¢ on your keyboard and thought it would be a great alternative to c
then only the last byte of the character would be stored.  At some
point I think it got fixed up so the keybuf is correct for cases
like this.


Messages sorted by: Reverse Date, Date, Thread, Author