vim-patch:8.2.4498: using <Plug> with "noremap" does not work

Problem:    Using <Plug> with "noremap" does not work.
Solution:   Always remap <Plug>. (closes vim/vim#9879, closes vim/vim#9789)
1fc34225ac
This commit is contained in:
zeertzjq
2022-03-03 21:59:28 +08:00
parent 7211d8ef21
commit e8107f0748
4 changed files with 35 additions and 10 deletions

View File

@@ -1712,11 +1712,10 @@ static int handle_mapping(int *keylenp, bool *timedout, int *mapdepth)
int local_State = get_real_state();
bool is_plug_map = false;
// Check if typehead starts with a <Plug> mapping.
// In that case we will ignore nore flag on it.
// If typehead starts with <Plug> then remap, even for a "noremap" mapping.
if (typebuf.tb_buf[typebuf.tb_off] == K_SPECIAL
&& typebuf.tb_buf[typebuf.tb_off+1] == KS_EXTRA
&& typebuf.tb_buf[typebuf.tb_off+2] == KE_PLUG) {
&& typebuf.tb_buf[typebuf.tb_off + 1] == KS_EXTRA
&& typebuf.tb_buf[typebuf.tb_off + 2] == KE_PLUG) {
is_plug_map = true;
}