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

bf321806bf
This commit is contained in:
zeertzjq
2024-01-29 07:27:15 +08:00
committed by GitHub
parent 56ae85a33c
commit ba7a52dedc
3 changed files with 11 additions and 9 deletions

View File

@@ -1146,10 +1146,10 @@ static void gotchars(const uint8_t *chars, size_t len)
maptick++;
}
/// Record a <Nop> key.
void gotchars_nop(void)
/// Record an <Ignore> 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 <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--;