]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.0060: Recorded register cannot be translated using keytrans() v9.1.0060
authorzeertzjq <zeertzjq@outlook.com>
Sun, 28 Jan 2024 18:03:00 +0000 (19:03 +0100)
committerChristian Brabandt <cb@256bit.org>
Sun, 28 Jan 2024 18:03:00 +0000 (19:03 +0100)
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>
runtime/syntax/vim.vim
src/getchar.c
src/normal.c
src/proto/getchar.pro
src/testdir/test_registers.vim
src/version.c

index f1944cab8aa2a9c701bd4f1c469fed8d87985646..4627f3ddf781c39256cc3f9e889aa350debbabd1 100644 (file)
@@ -13,7 +13,7 @@
 "      2024 Jan 23 by Vim Project (add :[23]match commands)
 "      2024 Jan 25 by Vim Project (WinNewPre autocommand)
 "      2024 Jan 27 by Vim Project (add foreach() function)
-"      2024 Jan 28 by Vim Project (improve line-continuation matching)
+"      2024 Jan 28 by Vim Project (improve line-continuation matching & string interpolation)
 " Version:     9.0-25
 " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_VIM
 " Automatically generated keyword lists: {{{1
index 3427a9f8da63fa65ef24b08e4eb5ff97627265b1..49a24f08b82af008b3a1a3fa2d69d4c748e7f06a 100644 (file)
@@ -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;
index fd89b00fd4ae6cb85a9cc56de17b2cb1bf1609c7..8a10b86d750db70fb9ebbce9a3baa4fcff1b4270 100644 (file)
@@ -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;
        }
     }
index b122a14d05533653fd544b4b14059a957c09d1cb..1473879130b6aa5f628644eb1c854a204a31e3a6 100644 (file)
@@ -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);
index 367d9149872e9f6c0fbdeebf1c54a22fdabf13f8..cb4cee7d99cab526d9558f50272a40dd2a3bbbf2 100644 (file)
@@ -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!')
index 841d0182fc08e100c8692f7e56747a375ca7726d..b78abeacddcd1b0645d94503b338f6d13686a1ec 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    60,
 /**/
     59,
 /**/