mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
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:
parent
56ae85a33c
commit
ba7a52dedc
@ -1146,10 +1146,10 @@ static void gotchars(const uint8_t *chars, size_t len)
|
|||||||
maptick++;
|
maptick++;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Record a <Nop> key.
|
/// Record an <Ignore> key.
|
||||||
void gotchars_nop(void)
|
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);
|
gotchars(nop_buf, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2746,9 +2746,9 @@ static int vgetorpeek(bool advance)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (timedout && c == ESC) {
|
if (timedout && c == ESC) {
|
||||||
// When recording there will be no timeout. Add a <Nop> after the ESC
|
// When recording there will be no timeout. Add an <Ignore> after the
|
||||||
// to avoid that it forms a key code with following characters.
|
// ESC to avoid that it forms a key code with following characters.
|
||||||
gotchars_nop();
|
gotchars_ignore();
|
||||||
}
|
}
|
||||||
|
|
||||||
vgetc_busy--;
|
vgetc_busy--;
|
||||||
|
@ -845,10 +845,10 @@ static void normal_get_additional_char(NormalState *s)
|
|||||||
no_mapping++;
|
no_mapping++;
|
||||||
// Vim may be in a different mode when the user types the next key,
|
// 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
|
// but when replaying a recording the next key is already in the
|
||||||
// typeahead buffer, so record a <Nop> before that to prevent the
|
// typeahead buffer, so record an <Ignore> before that to prevent
|
||||||
// vpeekc() above from applying wrong mappings when replaying.
|
// the vpeekc() above from applying wrong mappings when replaying.
|
||||||
no_u_sync++;
|
no_u_sync++;
|
||||||
gotchars_nop();
|
gotchars_ignore();
|
||||||
no_u_sync--;
|
no_u_sync--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -829,6 +829,8 @@ func Test_replay_charsearch_omap()
|
|||||||
call timer_start(10, {-> feedkeys(",bar\<Esc>q", 't')})
|
call timer_start(10, {-> feedkeys(",bar\<Esc>q", 't')})
|
||||||
call feedkeys('qrct[', 'xt!')
|
call feedkeys('qrct[', 'xt!')
|
||||||
call assert_equal(',bar[blah]', getline(1))
|
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
|
undo
|
||||||
call assert_equal('foo[blah]', getline(1))
|
call assert_equal('foo[blah]', getline(1))
|
||||||
call feedkeys('@r', 'xt!')
|
call feedkeys('@r', 'xt!')
|
||||||
|
Loading…
Reference in New Issue
Block a user