aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ops.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/ops.h')
-rw-r--r--src/nvim/ops.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/nvim/ops.h b/src/nvim/ops.h
index 99b9b6182d..5f6c3595fd 100644
--- a/src/nvim/ops.h
+++ b/src/nvim/ops.h
@@ -59,7 +59,8 @@ enum {
// The following registers should not be saved in ShaDa file:
STAR_REGISTER = 37,
PLUS_REGISTER = 38,
- NUM_REGISTERS = 39,
+ USER_REGISTER = 39,
+ NUM_REGISTERS = 40,
};
/// Operator IDs; The order must correspond to opchars[] in ops.c!
@@ -118,6 +119,7 @@ typedef enum {
YREG_PASTE,
YREG_YANK,
YREG_PUT,
+ YREG_NOEVAL = 0x10,
} yreg_mode_t;
#ifdef INCLUDE_GENERATED_DECLARATIONS
@@ -133,6 +135,10 @@ typedef enum {
static inline int op_reg_index(const int regname)
FUNC_ATTR_CONST
{
+ if (regname == 0 || regname == '"') {
+ return -1;
+ }
+
if (ascii_isdigit(regname)) {
return regname - '0';
} else if (ASCII_ISLOWER(regname)) {
@@ -146,7 +152,7 @@ static inline int op_reg_index(const int regname)
} else if (regname == '+') {
return PLUS_REGISTER;
} else {
- return -1;
+ return USER_REGISTER;
}
}