mirror of
https://github.com/neovim/neovim.git
synced 2025-12-10 08:32:42 +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:
@@ -4553,7 +4553,8 @@ static int uc_add_command(char_u *name, size_t name_len, char_u *rep,
|
||||
char_u *rep_buf = NULL;
|
||||
garray_T *gap;
|
||||
|
||||
replace_termcodes(rep, &rep_buf, FALSE, FALSE, FALSE);
|
||||
replace_termcodes(rep, STRLEN(rep), &rep_buf, false, false, false,
|
||||
CPO_TO_CPO_FLAGS);
|
||||
if (rep_buf == NULL) {
|
||||
/* Can't replace termcodes - try using the string as is */
|
||||
rep_buf = vim_strsave(rep);
|
||||
|
||||
Reference in New Issue
Block a user