* [BUG]: zle-line-pre-redraw breaks vi-repeat-change
@ 2020-10-07 12:49 Roman Perepelitsa
2020-10-07 13:25 ` Peter Stephenson
2020-12-16 8:33 ` Roman Perepelitsa
0 siblings, 2 replies; 6+ messages in thread
From: Roman Perepelitsa @ 2020-10-07 12:49 UTC (permalink / raw)
To: Zsh hackers list
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".
Roman.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [BUG]: zle-line-pre-redraw breaks vi-repeat-change
2020-10-07 12:49 [BUG]: zle-line-pre-redraw breaks vi-repeat-change Roman Perepelitsa
@ 2020-10-07 13:25 ` Peter Stephenson
2020-10-07 14:49 ` Roman Perepelitsa
2020-12-16 8:33 ` Roman Perepelitsa
1 sibling, 1 reply; 6+ messages in thread
From: Peter Stephenson @ 2020-10-07 13:25 UTC (permalink / raw)
To: Roman Perepelitsa, Zsh hackers list
> On 07 October 2020 at 13:49 Roman Perepelitsa <roman.perepelitsa@gmail.com> wrote:
>
>
> If zle-line-pre-redraw is defined, vi-repeat-change behaves as if the
> numeric argument was always 1.
I wonder if we need to change zlecallhook().
pws
diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c
index 8c0534708..1622d8a6b 100644
--- a/Src/Zle/zle_main.c
+++ b/Src/Zle/zle_main.c
@@ -1067,6 +1067,7 @@ redrawhook(void)
int old_incompfunc = incompfunc;
char *args[2];
Thingy lbindk_save = lbindk, bindk_save = bindk;
+ struct modifier zmod_save = zmod;
refthingy(lbindk_save);
refthingy(bindk_save);
@@ -1094,6 +1095,7 @@ redrawhook(void)
* restore lastcmd manually so that we don't mess up the global state
*/
lastcmd = lastcmd_prev;
+ zmod = zmod_save;
}
}
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [BUG]: zle-line-pre-redraw breaks vi-repeat-change
2020-10-07 13:25 ` Peter Stephenson
@ 2020-10-07 14:49 ` Roman Perepelitsa
0 siblings, 0 replies; 6+ messages in thread
From: Roman Perepelitsa @ 2020-10-07 14:49 UTC (permalink / raw)
To: Peter Stephenson; +Cc: Zsh hackers list
On Wed, Oct 7, 2020 at 3:25 PM Peter Stephenson
<p.w.stephenson@ntlworld.com> wrote:
>
> I wonder if we need to change zlecallhook().
After applying this patch I can still reproduce the issue.
Roman.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [BUG]: zle-line-pre-redraw breaks vi-repeat-change
2020-10-07 12:49 [BUG]: zle-line-pre-redraw breaks vi-repeat-change Roman Perepelitsa
2020-10-07 13:25 ` Peter Stephenson
@ 2020-12-16 8:33 ` Roman Perepelitsa
2021-01-26 20:55 ` Paul
1 sibling, 1 reply; 6+ messages in thread
From: Roman Perepelitsa @ 2020-12-16 8:33 UTC (permalink / raw)
To: Zsh hackers list; +Cc: GammaFunction
[-- Attachment #1: Type: text/plain, Size: 869 bytes --]
On Wed, Oct 7, 2020 at 2:49 PM Roman Perepelitsa
<roman.perepelitsa@gmail.com> 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@vivaldi.net (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.
[-- Attachment #2: restore-vi-repeat.patch.txt --]
[-- Type: text/plain, Size: 664 bytes --]
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);
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [BUG]: zle-line-pre-redraw breaks vi-repeat-change
2020-12-16 8:33 ` Roman Perepelitsa
@ 2021-01-26 20:55 ` Paul
2021-01-27 10:06 ` Peter Stephenson
0 siblings, 1 reply; 6+ messages in thread
From: Paul @ 2021-01-26 20:55 UTC (permalink / raw)
To: Roman Perepelitsa, Zsh hackers list
On Wed Dec 16, 2020 at 2:33 AM CST, Roman Perepelitsa wrote:
> On Wed, Oct 7, 2020 at 2:49 PM Roman Perepelitsa
> <roman.perepelitsa@gmail.com> 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@vivaldi.net (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.
Hey, I just want to bump this, I would like to see this merged soon.
The PR has a second commit which renames some identifiers to be more
consistent, feel free to ignore it.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [BUG]: zle-line-pre-redraw breaks vi-repeat-change
2021-01-26 20:55 ` Paul
@ 2021-01-27 10:06 ` Peter Stephenson
0 siblings, 0 replies; 6+ messages in thread
From: Peter Stephenson @ 2021-01-27 10:06 UTC (permalink / raw)
To: Paul, Zsh hackers list
> On 26 January 2021 at 20:55 Paul <GammaFunction@vivaldi.net> wrote:
> On Wed Dec 16, 2020 at 2:33 AM CST, Roman Perepelitsa wrote:
> > GammaFunction@vivaldi.net (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.
>
> Hey, I just want to bump this, I would like to see this merged soon.
That looks unproblematic, so I've pushed it.
pws
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-01-27 10:07 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-07 12:49 [BUG]: zle-line-pre-redraw breaks vi-repeat-change Roman Perepelitsa
2020-10-07 13:25 ` Peter Stephenson
2020-10-07 14:49 ` Roman Perepelitsa
2020-12-16 8:33 ` Roman Perepelitsa
2021-01-26 20:55 ` Paul
2021-01-27 10:06 ` Peter Stephenson
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).