aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/keycodes.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/keycodes.c')
-rw-r--r--src/nvim/keycodes.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/nvim/keycodes.c b/src/nvim/keycodes.c
index 301c3846e7..d913beeb0c 100644
--- a/src/nvim/keycodes.c
+++ b/src/nvim/keycodes.c
@@ -852,8 +852,8 @@ int get_mouse_button(int code, bool *is_click, bool *is_drag)
/// K_SPECIAL by itself is replaced by K_SPECIAL KS_SPECIAL KE_FILLER.
///
/// When "flags" has REPTERM_FROM_PART, trailing <C-v> is included, otherwise it is removed (to make
-/// ":map xx ^V" map xx to nothing). When cpo_flags contains FLAG_CPO_BSLASH, a backslash can be
-/// used in place of <C-v>. All other <C-v> characters are removed.
+/// ":map xx ^V" map xx to nothing). When cpo_val contains CPO_BSLASH, a backslash can be used in
+/// place of <C-v>. All other <C-v> characters are removed.
///
/// @param[in] from What characters to replace.
/// @param[in] from_len Length of the "from" argument.
@@ -867,20 +867,21 @@ int get_mouse_button(int code, bool *is_click, bool *is_drag)
/// REPTERM_NO_SPECIAL do not accept <key> notation
/// REPTERM_NO_SIMPLIFY do not simplify <C-H> into 0x08, etc.
/// @param[out] did_simplify set when some <C-H> code was simplified, unless it is NULL.
-/// @param[in] cpo_flags Relevant flags derived from p_cpo, see CPO_TO_CPO_FLAGS.
+/// @param[in] cpo_val The value of 'cpoptions' to use. Only CPO_BSLASH matters.
///
/// @return The same as what `*bufp` is set to.
char *replace_termcodes(const char *const from, const size_t from_len, char **const bufp,
const scid_T sid_arg, const int flags, bool *const did_simplify,
- const int cpo_flags)
- FUNC_ATTR_NONNULL_ARG(1, 3)
+ const char *const cpo_val)
+ FUNC_ATTR_NONNULL_ARG(1, 3, 7)
{
char key;
size_t dlen = 0;
const char *src;
const char *const end = from + from_len - 1;
- const bool do_backslash = !(cpo_flags & FLAG_CPO_BSLASH); // backslash is a special character
+ // backslash is a special character
+ const bool do_backslash = (vim_strchr(cpo_val, CPO_BSLASH) == NULL);
const bool do_special = !(flags & REPTERM_NO_SPECIAL);
bool allocated = (*bufp == NULL);