aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/keymap.h
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2014-07-13 11:10:27 +0400
committerZyX <kp-pav@yandex.ru>2016-04-18 02:43:43 +0300
commitebabdff5cd24f2d30ab35051d1d65f7c29fa3dd3 (patch)
tree0bae55f8b469efbef6df94dd16394ea334b22a55 /src/nvim/keymap.h
parent83c683f5e15867c2e2889442860e91fd1074b4e1 (diff)
downloadrneovim-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/keymap.h')
-rw-r--r--src/nvim/keymap.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/nvim/keymap.h b/src/nvim/keymap.h
index 8f9980c6b4..bb8ba84a6a 100644
--- a/src/nvim/keymap.h
+++ b/src/nvim/keymap.h
@@ -1,6 +1,8 @@
#ifndef NVIM_KEYMAP_H
#define NVIM_KEYMAP_H
+#include "nvim/strings.h"
+
/*
* Keycode definitions for special keys.
*
@@ -461,6 +463,14 @@ enum key_extra {
// This is a total of 6 tokens, and is currently the longest one possible.
#define MAX_KEY_CODE_LEN 6
+#define FLAG_CPO_BSLASH 0x01
+#define FLAG_CPO_SPECI 0x02
+#define CPO_TO_CPO_FLAGS (((vim_strchr(p_cpo, CPO_BSLASH) == NULL) \
+ ? 0 \
+ : FLAG_CPO_BSLASH)| \
+ (vim_strchr(p_cpo, CPO_SPECI) == NULL \
+ ? 0 \
+ : FLAG_CPO_SPECI))
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "keymap.h.generated.h"