normal.h
Go to the documentation of this file.
1 #ifndef NVIM_NORMAL_H
2 #define NVIM_NORMAL_H
3 
4 #include <stdbool.h>
5 #include "nvim/pos.h"
6 #include "nvim/buffer_defs.h" // for win_T
7 
8 /* Values for find_ident_under_cursor() */
9 #define FIND_IDENT 1 /* find identifier (word) */
10 #define FIND_STRING 2 /* find any string (WORD) */
11 #define FIND_EVAL 4 /* include "->", "[]" and "." */
12 
17 typedef enum {
21  kMTUnknown = -1
22 } MotionType;
23 
24 /*
25  * Arguments for operators.
26  */
27 typedef struct oparg_S {
28  int op_type; // current pending operator type
29  int regname; // register to use for the operator
30  MotionType motion_type; // type of the current cursor motion
31  int motion_force; // force motion type: 'v', 'V' or CTRL-V
32  bool use_reg_one; // true if delete uses reg 1 even when not
33  // linewise
34  bool inclusive; // true if char motion is inclusive (only
35  // valid when motion_type is kMTCharWise)
36  bool end_adjusted; // backuped b_op_end one char (only used by
37  // do_format())
38  pos_T start; // start of the operator
39  pos_T end; // end of the operator
40  pos_T cursor_start; // cursor position before motion for "gw"
41 
42  long line_count; // number of lines from op_start to op_end
43  // (inclusive)
44  bool empty; // op_start and op_end the same (only used by
45  // op_change())
46  bool is_VIsual; // operator on Visual area
47  colnr_T start_vcol; // start col for block mode operator
48  colnr_T end_vcol; // end col for block mode operator
49  long prev_opcount; // ca.opcount saved for K_EVENT
50  long prev_count0; // ca.count0 saved for K_EVENT
51 } oparg_T;
52 
53 /*
54  * Arguments for Normal mode commands.
55  */
56 typedef struct cmdarg_S {
57  oparg_T *oap; /* Operator arguments */
58  int prechar; /* prefix character (optional, always 'g') */
59  int cmdchar; /* command character */
60  int nchar; /* next command character (optional) */
61  int ncharC1; /* first composing character (optional) */
62  int ncharC2; /* second composing character (optional) */
63  int extra_char; /* yet another character (optional) */
64  long opcount; /* count before an operator */
65  long count0; /* count before command, default 0 */
66  long count1; /* count before command, default 1 */
67  int arg; /* extra argument from nv_cmds[] */
68  int retval; /* return: CA_* values */
69  char_u *searchbuf; /* return: pointer to search pattern or NULL */
70 } cmdarg_T;
71 
72 /* values for retval: */
73 #define CA_COMMAND_BUSY 1 /* skip restarting edit() once */
74 #define CA_NO_ADJ_OP_END 2 /* don't adjust operator end */
75 
76 
77 #ifdef INCLUDE_GENERATED_DECLARATIONS
78 # include "normal.h.generated.h"
79 #endif
80 #endif // NVIM_NORMAL_H
MotionType motion_type
Definition: normal.h:30
struct cmdarg_S cmdarg_T
int cmdchar
Definition: normal.h:59
MotionType
Definition: normal.h:17
bool empty
Definition: normal.h:44
Unknown or invalid motion type.
Definition: normal.h:21
int regname
Definition: normal.h:29
pos_T start
Definition: normal.h:38
long prev_count0
Definition: normal.h:50
int extra_char
Definition: normal.h:63
long count0
Definition: normal.h:65
long line_count
Definition: normal.h:42
long opcount
Definition: normal.h:64
int colnr_T
Column number type.
Definition: pos.h:9
bool is_VIsual
Definition: normal.h:46
int ncharC2
Definition: normal.h:62
struct oparg_S oparg_T
Definition: normal.h:27
int nchar
Definition: normal.h:60
block-wise movement/register
Definition: normal.h:20
pos_T end
Definition: normal.h:39
bool use_reg_one
Definition: normal.h:32
int prechar
Definition: normal.h:58
character-wise movement/register
Definition: normal.h:18
char_u * searchbuf
Definition: normal.h:69
bool inclusive
Definition: normal.h:34
int motion_force
Definition: normal.h:31
colnr_T start_vcol
Definition: normal.h:47
int op_type
Definition: normal.h:28
unsigned char char_u
Definition: types.h:11
int arg
Definition: normal.h:67
long count1
Definition: normal.h:66
Definition: normal.h:56
int ncharC1
Definition: normal.h:61
Definition: pos.h:21
int retval
Definition: normal.h:68
line-wise movement/register
Definition: normal.h:19
oparg_T * oap
Definition: normal.h:57
long prev_opcount
Definition: normal.h:49
pos_T cursor_start
Definition: normal.h:40
colnr_T end_vcol
Definition: normal.h:48
bool end_adjusted
Definition: normal.h:36