mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 14:08:32 +00:00
perf(map): avoid extraneous heap allocations when setting mappings
- don't immediately vim_strsave and then xfree a heap buffer. - allow replace_termcodes to take in a buffer instead of allocating it - grug! memory allocation bad!
This commit is contained in:
@@ -3025,6 +3025,7 @@ ambw_end:
|
||||
} else if (varp == &p_pt) {
|
||||
// 'pastetoggle': translate key codes like in a mapping
|
||||
if (*p_pt) {
|
||||
p = NULL;
|
||||
(void)replace_termcodes((char *)p_pt,
|
||||
STRLEN(p_pt),
|
||||
(char **)&p, REPTERM_FROM_PART | REPTERM_DO_LT, NULL,
|
||||
|
Reference in New Issue
Block a user