mirror of
https://github.com/neovim/neovim.git
synced 2025-09-27 13:38:34 +00:00
Record :lmap transformed keys in gotchars()
The mental model of :lmap and 'keymap' is of a transformation done before anything else. Hence when recording a macro, or writing to a scriptfile, the transformed keys should be recorded instead of the keys before the transformation.
This commit is contained in:
@@ -1939,8 +1939,9 @@ static int vgetorpeek(int advance)
|
|||||||
char_u *save_m_keys;
|
char_u *save_m_keys;
|
||||||
char_u *save_m_str;
|
char_u *save_m_str;
|
||||||
|
|
||||||
// write chars to script file(s)
|
// Write chars to script file(s)
|
||||||
if (keylen > typebuf.tb_maplen) {
|
// Note: :lmap mappings are written *after* being applied. #5658
|
||||||
|
if (keylen > typebuf.tb_maplen && (mp->m_mode & LANGMAP) == 0) {
|
||||||
gotchars(typebuf.tb_buf + typebuf.tb_off + typebuf.tb_maplen,
|
gotchars(typebuf.tb_buf + typebuf.tb_off + typebuf.tb_maplen,
|
||||||
(size_t)(keylen - typebuf.tb_maplen));
|
(size_t)(keylen - typebuf.tb_maplen));
|
||||||
}
|
}
|
||||||
@@ -2015,6 +2016,12 @@ static int vgetorpeek(int advance)
|
|||||||
else {
|
else {
|
||||||
int noremap;
|
int noremap;
|
||||||
|
|
||||||
|
// If this is a LANGMAP mapping, then we didn't record the keys
|
||||||
|
// at the start of the function and have to record them now.
|
||||||
|
if (keylen > typebuf.tb_maplen && (mp->m_mode & LANGMAP) != 0) {
|
||||||
|
gotchars(s, STRLEN(s));
|
||||||
|
}
|
||||||
|
|
||||||
if (save_m_noremap != REMAP_YES)
|
if (save_m_noremap != REMAP_YES)
|
||||||
noremap = save_m_noremap;
|
noremap = save_m_noremap;
|
||||||
else if (
|
else if (
|
||||||
|
Reference in New Issue
Block a user