diff options
author | ZyX <kp-pav@yandex.ru> | 2014-07-13 11:10:27 +0400 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2016-04-18 02:43:43 +0300 |
commit | ebabdff5cd24f2d30ab35051d1d65f7c29fa3dd3 (patch) | |
tree | 0bae55f8b469efbef6df94dd16394ea334b22a55 /src/nvim/menu.c | |
parent | 83c683f5e15867c2e2889442860e91fd1074b4e1 (diff) | |
download | rneovim-ebabdff5cd24f2d30ab35051d1d65f7c29fa3dd3.tar.gz rneovim-ebabdff5cd24f2d30ab35051d1d65f7c29fa3dd3.tar.bz2 rneovim-ebabdff5cd24f2d30ab35051d1d65f7c29fa3dd3.zip |
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.
Diffstat (limited to 'src/nvim/menu.c')
-rw-r--r-- | src/nvim/menu.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/nvim/menu.c b/src/nvim/menu.c index 91a72abfc5..3c2394d579 100644 --- a/src/nvim/menu.c +++ b/src/nvim/menu.c @@ -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; |