mirror of
https://github.com/neovim/neovim.git
synced 2025-09-20 10:18:18 +00:00
keymap: Make replace_termcodes and friends accept length and cpo_flags
Reasons: - One does not have to do `s[len] = NUL` to work with these functions if they do not need to replace the whole string: thus `s` may be const. - One does not have to save/restore p_cpo to work with them.
This commit is contained in:
@@ -215,10 +215,12 @@ ex_menu (
|
||||
if (STRICMP(map_to, "<nop>") == 0) { /* "<Nop>" means nothing */
|
||||
map_to = (char_u *)"";
|
||||
map_buf = NULL;
|
||||
} else if (modes & MENU_TIP_MODE)
|
||||
map_buf = NULL; /* Menu tips are plain text. */
|
||||
else
|
||||
map_to = replace_termcodes(map_to, &map_buf, FALSE, TRUE, special);
|
||||
} else if (modes & MENU_TIP_MODE) {
|
||||
map_buf = NULL; // Menu tips are plain text.
|
||||
} else {
|
||||
map_to = replace_termcodes(map_to, STRLEN(map_to), &map_buf, false, true,
|
||||
special, CPO_TO_CPO_FLAGS);
|
||||
}
|
||||
menuarg.modes = modes;
|
||||
menuarg.noremap[0] = noremap;
|
||||
menuarg.silent[0] = silent;
|
||||
|
Reference in New Issue
Block a user