mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Merge pull request #17202 from zeertzjq/unused-orig-rhs
refactor: allocate an empty string as unused orig_rhs for Lua mappings
This commit is contained in:
commit
49837dc805
@ -2670,9 +2670,10 @@ void set_maparg_lhs_rhs(const char_u *orig_lhs, const size_t orig_lhs_len,
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
char tmp_buf[64];
|
char tmp_buf[64];
|
||||||
|
// orig_rhs is not used for Lua mappings, but still needs to be a string.
|
||||||
|
mapargs->orig_rhs = xcalloc(1, sizeof(char_u));
|
||||||
|
mapargs->orig_rhs_len = 0;
|
||||||
// stores <lua>ref_no<cr> in map_str
|
// stores <lua>ref_no<cr> in map_str
|
||||||
mapargs->orig_rhs_len = (size_t)vim_snprintf(S_LEN(tmp_buf), "<LUA>%d<CR>", rhs_lua);
|
|
||||||
mapargs->orig_rhs = vim_strsave((char_u *)tmp_buf);
|
|
||||||
mapargs->rhs_len = (size_t)vim_snprintf(S_LEN(tmp_buf), "%c%c%c%d\r", K_SPECIAL,
|
mapargs->rhs_len = (size_t)vim_snprintf(S_LEN(tmp_buf), "%c%c%c%d\r", K_SPECIAL,
|
||||||
(char_u)KEY2TERMCAP0(K_LUA), KEY2TERMCAP1(K_LUA),
|
(char_u)KEY2TERMCAP0(K_LUA), KEY2TERMCAP1(K_LUA),
|
||||||
rhs_lua);
|
rhs_lua);
|
||||||
|
Loading…
Reference in New Issue
Block a user