aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/normal.h
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2016-05-01 13:43:39 +0200
committerBjörn Linse <bjorn.linse@gmail.com>2016-05-01 13:43:39 +0200
commit121987c5cce8417591fed64179c8f93d0055b43e (patch)
treec6ad056fbad0ae9242af84a084062b9906b9efe7 /src/nvim/normal.h
parent3dc8cdc1504edfd1ab44d9151954f859ab9befe2 (diff)
parent6cc15ccc3bd08edf06a41dd1c21b24b75a844ba2 (diff)
downloadrneovim-121987c5cce8417591fed64179c8f93d0055b43e.tar.gz
rneovim-121987c5cce8417591fed64179c8f93d0055b43e.tar.bz2
rneovim-121987c5cce8417591fed64179c8f93d0055b43e.zip
Merge pull request #4597 from bfredl/motion
convert MCHAR operator and register types to enum MotionType
Diffstat (limited to 'src/nvim/normal.h')
-rw-r--r--src/nvim/normal.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/nvim/normal.h b/src/nvim/normal.h
index 95619c7ef6..51170105ed 100644
--- a/src/nvim/normal.h
+++ b/src/nvim/normal.h
@@ -10,18 +10,29 @@
#define FIND_STRING 2 /* find any string (WORD) */
#define FIND_EVAL 4 /* include "->", "[]" and "." */
+/// Motion types, used for operators and for yank/delete registers.
+///
+/// The three valid numerical values must not be changed, as they
+/// are used in external communication and serialization.
+typedef enum {
+ kMTCharWise = 0, ///< character-wise movement/register
+ kMTLineWise = 1, ///< line-wise movement/register
+ kMTBlockWise = 2, ///< block-wise movement/register
+ kMTUnknown = -1 ///< Unknown or invalid motion type
+} MotionType;
+
/*
* Arguments for operators.
*/
typedef struct oparg_S {
int op_type; // current pending operator type
int regname; // register to use for the operator
- int motion_type; // type of the current cursor motion
+ MotionType motion_type; // type of the current cursor motion
int motion_force; // force motion type: 'v', 'V' or CTRL-V
bool use_reg_one; // true if delete uses reg 1 even when not
// linewise
bool inclusive; // true if char motion is inclusive (only
- // valid when motion_type is MCHAR)
+ // valid when motion_type is kMTCharWise)
bool end_adjusted; // backuped b_op_end one char (only used by
// do_format())
pos_T start; // start of the operator