feat(lua): pass keys before mapping to vim.on_key() callback (#28098)

Keys before mapping (i.e. typed keys) are passed as the second argument.
This commit is contained in:
zeertzjq
2024-03-31 11:20:05 +08:00
committed by GitHub
parent 12240600f5
commit e1ff2c51ca
11 changed files with 139 additions and 26 deletions

View File

@@ -1078,7 +1078,7 @@ static int normal_execute(VimState *state, int key)
// When "restart_edit" is set fake a "d"elete command, Insert mode will restart automatically.
// Insert the typed character in the typeahead buffer, so that it can
// be mapped in Insert mode. Required for ":lmap" to work.
int len = ins_char_typebuf(vgetc_char, vgetc_mod_mask);
int len = ins_char_typebuf(vgetc_char, vgetc_mod_mask, true);
// When recording and gotchars() was called the character will be
// recorded again, remove the previous recording.