mirror of
https://github.com/neovim/neovim.git
synced 2025-09-27 13:38:34 +00:00
vim-patch:9.0.1694: wrong mapping applied when replaying a char search (#24670)
Problem: wrong mapping applied when replaying a char search
Solution: Store a NOP after the ESC
closes: vim/vim#12708
closes: vim/vim#6350
bacc83009b
This commit is contained in:
@@ -1147,6 +1147,13 @@ static void gotchars(const uint8_t *chars, size_t len)
|
||||
maptick++;
|
||||
}
|
||||
|
||||
/// Record a <Nop> key.
|
||||
void gotchars_nop(void)
|
||||
{
|
||||
uint8_t nop_buf[3] = { K_SPECIAL, KS_EXTRA, KE_NOP };
|
||||
gotchars(nop_buf, 3);
|
||||
}
|
||||
|
||||
/// Undo the last gotchars() for "len" bytes. To be used when putting a typed
|
||||
/// character back into the typeahead buffer, thus gotchars() will be called
|
||||
/// again.
|
||||
@@ -2745,14 +2752,9 @@ static int vgetorpeek(bool advance)
|
||||
}
|
||||
|
||||
if (timedout && c == ESC) {
|
||||
uint8_t nop_buf[3];
|
||||
|
||||
// When recording there will be no timeout. Add a <Nop> after the ESC
|
||||
// to avoid that it forms a key code with following characters.
|
||||
nop_buf[0] = K_SPECIAL;
|
||||
nop_buf[1] = KS_EXTRA;
|
||||
nop_buf[2] = KE_NOP;
|
||||
gotchars(nop_buf, 3);
|
||||
gotchars_nop();
|
||||
}
|
||||
|
||||
vgetc_busy--;
|
||||
|
Reference in New Issue
Block a user