Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [BUG]: zle-line-pre-redraw breaks vi-repeat-change
- X-seq: zsh-workers 47744
- From: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: [BUG]: zle-line-pre-redraw breaks vi-repeat-change
- Date: Wed, 16 Dec 2020 09:33:31 +0100
- Archived-at: <https://zsh.org/workers/47744>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-workers/2020-12/CAN%3D4vMqPA1WAt6_Kj99_PGH%2BEvOpcK5So3bON5sjBzzmeikeXg%40mail.gmail.com>
- Authentication-results: zsh.org; iprev=pass (mail-il1-f177.google.com) smtp.remote-ip=209.85.166.177; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none
- Cc: GammaFunction@xxxxxxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qkNL/2beru7nvbmU+ngh94wTf1LE01cyMVy9Uwl0l+I=; b=vTm6/BHyyif839mWaeuY/HJlDz69sPASlLLPoOE/5R+cZBSgcy5D8FE/16nzi2llXb jPp4Uu74nz7SlqdTc2ZKb3DNy2inN1LwQWhYs5upHOt69fxNUJ9aVIe6UkycCXRvn2QE 3cukaquce+lYdiOtu1RC5PiFjhSfR6hY72bIQFWc7jJQwMdL9MBnAchFXr588QXovouW BIsQcO0fBaUYJnY3R1AZhy6bs6xAounUjsiVMIqWiEUpwZTs2baNW+yc24x035FCg1wD FxqKLeItw4wA0FUB0g5St0gsgp5BaXJLzlYgbUzlOEZWEGAoprUia7jkMAY1P8XhsahE cSmA==
- In-reply-to: <CAN=4vMrW8jtzoAATn888q=rXpukYTt6V6HEdGGo-tVn=Vaoz-A@mail.gmail.com>
- List-archive: <http://www.zsh.org/sympa/arc/zsh-workers>
- List-help: <mailto:sympa@zsh.org?subject=help>
- List-id: <zsh-workers.zsh.org>
- List-owner: <mailto:zsh-workers-request@zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-subscribe: <mailto:sympa@zsh.org?subject=subscribe%20zsh-workers>
- List-unsubscribe: <mailto:sympa@zsh.org?subject=unsubscribe%20zsh-workers>
- References: <CAN=4vMrW8jtzoAATn888q=rXpukYTt6V6HEdGGo-tVn=Vaoz-A@mail.gmail.com>
- Sender: zsh-workers-request@xxxxxxx
On Wed, Oct 7, 2020 at 2:49 PM Roman Perepelitsa
<roman.perepelitsa@xxxxxxxxx> wrote:
>
> If zle-line-pre-redraw is defined, vi-repeat-change behaves as if the
> numeric argument was always 1.
>
> To reproduce from `zsh -f`:
>
> % function zle-line-pre-redraw() {}
> % zle -N zle-line-pre-redraw
> % bindkey -v
> % 123456<ESC><2X><.>
>
> The last line in more detail:
>
> - "123456" is self-insert
> - ESC is vi-cmd-mode
> - "2X" is vi-backward-delete-char with NUMERIC = 2
> - "." is vi-repeat-change
>
> Expected: BUFFER contains "16".
>
> Actual: BUFFER contains "126".
>
> The actual behavior is unchanged if <.> is replaced with <3.>. The
> expected BUFFER in this case is "6".
GammaFunction@xxxxxxxxxxx (CC-ed) has sent
https://github.com/zsh-users/zsh/pull/69 that fixes the two tests I've
described above. Here's the patch from the PR.
Roman.
diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c
index 8c0534708..0561c3b3b 100644
--- a/Src/Zle/zle_main.c
+++ b/Src/Zle/zle_main.c
@@ -1065,6 +1065,7 @@ redrawhook(void)
int saverrflag = errflag, savretflag = retflag;
int lastcmd_prev = lastcmd;
int old_incompfunc = incompfunc;
+ int old_viinrepeat = viinrepeat;
char *args[2];
Thingy lbindk_save = lbindk, bindk_save = bindk;
@@ -1079,6 +1080,7 @@ redrawhook(void)
incompfunc = 0;
execzlefunc(initthingy, args, 1, 0);
incompfunc = old_incompfunc;
+ viinrepeat = old_viinrepeat;
/* Restore errflag and retflag as zlecallhook() does */
errflag = saverrflag | (errflag & ERRFLAG_INT);
Messages sorted by:
Reverse Date,
Date,
Thread,
Author