From ba7a52dedc5dd335f22522ec17a0393e068187e3 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 29 Jan 2024 07:27:15 +0800 Subject: vim-patch:9.1.0060: Recorded register cannot be translated using keytrans() (#27247) 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: vim/vim#13916 closes: vim/vim#13925 https://github.com/vim/vim/commit/bf321806bf44d59f108fd7e5a0eaead04682701d --- src/nvim/getchar.c | 12 ++++++------ src/nvim/normal.c | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c index 03bc953368..d3411850fd 100644 --- a/src/nvim/getchar.c +++ b/src/nvim/getchar.c @@ -1146,10 +1146,10 @@ static void gotchars(const uint8_t *chars, size_t len) maptick++; } -/// Record a key. -void gotchars_nop(void) +/// Record an key. +void gotchars_ignore(void) { - uint8_t nop_buf[3] = { K_SPECIAL, KS_EXTRA, KE_NOP }; + uint8_t nop_buf[3] = { K_SPECIAL, KS_EXTRA, KE_IGNORE }; gotchars(nop_buf, 3); } @@ -2746,9 +2746,9 @@ static int vgetorpeek(bool advance) } if (timedout && c == ESC) { - // When recording there will be no timeout. Add a 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 after the + // ESC to avoid that it forms a key code with following characters. + gotchars_ignore(); } vgetc_busy--; diff --git a/src/nvim/normal.c b/src/nvim/normal.c index ed2b1437ec..8c388b4318 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -845,10 +845,10 @@ static void normal_get_additional_char(NormalState *s) 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 before that to prevent the - // vpeekc() above from applying wrong mappings when replaying. + // typeahead buffer, so record an before that to prevent + // the vpeekc() above from applying wrong mappings when replaying. no_u_sync++; - gotchars_nop(); + gotchars_ignore(); no_u_sync--; } } -- cgit