Zsh Mailing List Archive
Messages sorted by:
Re: Bug in ZSH's vi emulation
- X-seq: zsh-workers 39807
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: Bug in ZSH's vi emulation
- Date: Wed, 02 Nov 2016 17:51:23 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1478105484; bh=bo4N60qzYbsdZuDBZwiGIgmjS+FLaGCjdiBVv2g7IgI=; h=In-reply-to:From:References:To:Subject:Date:From:Subject; b=olGKRnrO+OuI9llNTU8DseulqdT36P3jkxmlSqfd8vkZ9B0FNSMlBOlZqhUKLEdLSJFSLmBduDpRb4JsuJKZYYGSWNK1dIz9zE2XHxqYXXn9ucXrza2f95GLh/bn3rfn+bf45mk+c4nETpBXudUL3oedV5G4lkK7GHMp2zSCG506dyJIzxlxdP5qxLVtoKl5Bp3lQl++H56uj+5j+teA9SwuoSu26SE2kjaTKT/eXdSlFMWSyO+Su+Y6HRZ826Ht1qjCx4UxmpX6DaF16Bzkx6cGJxkRQyEAZ61+MhFSEe1wA8288kXb5c8EfA9q5X/GgpnP+KZctK1CcHVJ+NVGOQ==
- In-reply-to: <20161102045925.GA6763@fujitsu.shahaf.local2>
- List-help: <mailto:email@example.com>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:firstname.lastname@example.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>
Daniel Shahaf wrote:
> > On Oct 5, 10:09am, Ghjuvan' Lacambre wrote:
> > } 'd.' isn't a valid action as '.' is not a valid motion, yet 'd.' is
> > } recorded as the last action called. When using '.', 'd.' will
> > } recursively call itself
> Is it simply a matter of setting vichgbufptr to 0 if getvirange()
> returns -1? I've tried that; it fixes the problem and passes
Not really. If we want a quick fix for 5.3 then either that or checking
virangeflag at the top of virepeatchange will do the job.
For a correct vi compatible fix, anything that causes the widget -
vi-delete or whatever to return failure should abort the vi change
and the previous value of vichgbuf should be restored. So most
occurences of vichgflag = 0 could change to call a new endvichange() which
would do the restore. Or that might be factored out into the caller.
I'm also pondering the interaction with user-defined widgets.
Note that from vi, with a key mapping of :nmap \d dwdw
Then, \d followed by dot will remove three words not four.
dot only repeats the final change. In practice this isn't especially
useful so things like the repeat.vim plugin exist. I'm not sure
that we should even strive for vi compatibility here but I think
we're missing some logic in cases where calls to startvichange occur
as part of a user-defined widget.
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.
Messages sorted by: