summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-01-28 19:03:00 +0100
committerChristian Brabandt <cb@256bit.org>2024-01-28 19:03:00 +0100
commitbf321806bf44d59f108fd7e5a0eaead04682701d (patch)
treea85148304c17b07d8d4ca3d028cd844fdba31474 /src
parentcf8695d48cdded63043430af5a84185e9614e84c (diff)
patch 9.1.0060: Recorded register cannot be translated using keytrans()v9.1.0060
Problem: Recorded register cannot be translated using keytrans() when it involves character search (iddqd505) Solution: Record a K_IGNORE instead of a K_NOP (zeertzjq) related: #13916 closes: #13925 Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'src')
-rw-r--r--src/getchar.c12
-rw-r--r--src/normal.c6
-rw-r--r--src/proto/getchar.pro2
-rw-r--r--src/testdir/test_registers.vim2
-rw-r--r--src/version.c2
5 files changed, 14 insertions, 10 deletions
diff --git a/src/getchar.c b/src/getchar.c
index 3427a9f8da..49a24f08b8 100644
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -1339,12 +1339,12 @@ gotchars(char_u *chars, int len)
}
/*
- * Record a <Nop> key.
+ * Record an <Ignore> key.
*/
void
-gotchars_nop(void)
+gotchars_ignore(void)
{
- char_u nop_buf[3] = { K_SPECIAL, KS_EXTRA, KE_NOP };
+ char_u nop_buf[3] = { K_SPECIAL, KS_EXTRA, KE_IGNORE };
gotchars(nop_buf, 3);
}
@@ -3666,9 +3666,9 @@ vgetorpeek(int advance)
#endif
if (timedout && c == ESC)
{
- // When recording there will be no timeout. Add a <Nop> after the ESC
- // to avoid that it forms a key code with following characters.
- gotchars_nop();
+ // When recording there will be no timeout. Add an <Ignore> after the
+ // ESC to avoid that it forms a key code with following characters.
+ gotchars_ignore();
}
--vgetc_busy;
diff --git a/src/normal.c b/src/normal.c
index fd89b00fd4..8a10b86d75 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -568,10 +568,10 @@ normal_cmd_get_more_chars(
++no_mapping;
// Vim may be in a different mode when the user types the next key,
// but when replaying a recording the next key is already in the
- // typeahead buffer, so record a <Nop> before that to prevent the
- // vpeekc() above from applying wrong mappings when replaying.
+ // typeahead buffer, so record an <Ignore> before that to prevent
+ // the vpeekc() above from applying wrong mappings when replaying.
++no_u_sync;
- gotchars_nop();
+ gotchars_ignore();
--no_u_sync;
}
}
diff --git a/src/proto/getchar.pro b/src/proto/getchar.pro
index b122a14d05..1473879130 100644
--- a/src/proto/getchar.pro
+++ b/src/proto/getchar.pro
@@ -30,7 +30,7 @@ int typebuf_changed(int tb_change_cnt);
int typebuf_typed(void);
int typebuf_maplen(void);
void del_typebuf(int len, int offset);
-void gotchars_nop(void);
+void gotchars_ignore(void);
void ungetchars(int len);
int save_typebuf(void);
void save_typeahead(tasave_T *tp);
diff --git a/src/testdir/test_registers.vim b/src/testdir/test_registers.vim
index 367d914987..cb4cee7d99 100644
--- a/src/testdir/test_registers.vim
+++ b/src/testdir/test_registers.vim
@@ -868,6 +868,8 @@ func Test_replay_charsearch_omap()
call timer_start(10, {-> feedkeys(",bar\<Esc>q", 't')})
call feedkeys('qrct[', 'xt!')
call assert_equal(',bar[blah]', getline(1))
+ call assert_equal("ct[\<Ignore>,bar\<Esc>", @r)
+ call assert_equal('ct[<Ignore>,bar<Esc>', keytrans(@r))
undo
call assert_equal('foo[blah]', getline(1))
call feedkeys('@r', 'xt!')
diff --git a/src/version.c b/src/version.c
index 841d0182fc..b78abeacdd 100644
--- a/src/version.c
+++ b/src/version.c
@@ -705,6 +705,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 60,
+/**/
59,
/**/
58,