ex_docmd.h
Go to the documentation of this file.
1 #ifndef NVIM_EX_DOCMD_H
2 #define NVIM_EX_DOCMD_H
3 
4 #include "nvim/eval/funcs.h"
5 #include "nvim/ex_cmds_defs.h"
6 #include "nvim/globals.h"
7 
8 // flags for do_cmdline()
9 #define DOCMD_VERBOSE 0x01 // included command in error message
10 #define DOCMD_NOWAIT 0x02 // don't call wait_return() and friends
11 #define DOCMD_REPEAT 0x04 // repeat exec. until getline() returns NULL
12 #define DOCMD_KEYTYPED 0x08 // don't reset KeyTyped
13 #define DOCMD_EXCRESET 0x10 // reset exception environment (for debugging
14 #define DOCMD_KEEPLINE 0x20 // keep typed line for repeating with "."
15 #define DOCMD_PREVIEW 0x40 // during 'inccommand' preview
16 
17 // defines for eval_vars()
18 #define VALID_PATH 1
19 #define VALID_HEAD 2
20 
21 // Structure used to save the current state. Used when executing Normal mode
22 // commands while in any other mode.
23 typedef struct {
34 } save_state_T;
35 
36 typedef struct ucmd {
37  char_u *uc_name; // The command name
38  uint32_t uc_argt; // The argument type
39  char_u *uc_rep; // The command's replacement string
40  long uc_def; // The default value for a range/count
41  int uc_compl; // completion type
42  cmd_addr_T uc_addr_type; // The command's address type
43  sctx_T uc_script_ctx; // SCTX where the command was defined
44  char_u *uc_compl_arg; // completion argument if any
45  LuaRef uc_compl_luaref; // Reference to Lua completion function
46  LuaRef uc_luaref; // Reference to Lua function
47 } ucmd_T;
48 
49 #define UC_BUFFER 1 // -buffer: local to current buffer
50 
51 extern garray_T ucmds;
52 
53 #define USER_CMD(i) (&((ucmd_T *)(ucmds.ga_data))[i])
54 #define USER_CMD_GA(gap, i) (&((ucmd_T *)((gap)->ga_data))[i])
55 
56 #ifdef INCLUDE_GENERATED_DECLARATIONS
57 # include "ex_docmd.h.generated.h"
58 #endif
59 #endif // NVIM_EX_DOCMD_H
ucmd::uc_def
long uc_def
Definition: ex_docmd.h:40
ucmd_T
struct ucmd ucmd_T
ucmds
garray_T ucmds
Definition: ex_docmd.c:91
ucmd::uc_compl_arg
char_u * uc_compl_arg
Definition: ex_docmd.h:44
ucmd::uc_compl
int uc_compl
Definition: ex_docmd.h:41
ucmd::uc_argt
uint32_t uc_argt
Definition: ex_docmd.h:38
tasave_T
Definition: buffer_defs.h:337
save_state_T::save_opcount
long save_opcount
Definition: ex_docmd.h:30
ucmd::uc_luaref
LuaRef uc_luaref
Definition: ex_docmd.h:46
ucmd::uc_name
char_u * uc_name
Definition: ex_docmd.h:37
ucmd::uc_addr_type
cmd_addr_T uc_addr_type
Definition: ex_docmd.h:42
sctx_T
Definition: typval.h:280
LuaRef
int LuaRef
Definition: types.h:23
growarray
Definition: garray.h:12
globals.h
save_state_T
Definition: ex_docmd.h:23
ucmd::uc_rep
char_u * uc_rep
Definition: ex_docmd.h:39
save_state_T::save_reg_executing
int save_reg_executing
Definition: ex_docmd.h:31
cmd_addr_T
cmd_addr_T
Definition: ex_cmds_defs.h:71
save_state_T::save_pending_end_reg_executing
bool save_pending_end_reg_executing
Definition: ex_docmd.h:32
ucmd::uc_script_ctx
sctx_T uc_script_ctx
Definition: ex_docmd.h:43
ucmd::uc_compl_luaref
LuaRef uc_compl_luaref
Definition: ex_docmd.h:45
save_state_T::tabuf
tasave_T tabuf
Definition: ex_docmd.h:33
char_u
unsigned char char_u
Definition: types.h:12
ex_cmds_defs.h
save_state_T::save_insertmode
int save_insertmode
Definition: ex_docmd.h:28
save_state_T::save_restart_edit
int save_restart_edit
Definition: ex_docmd.h:25
save_state_T::save_finish_op
bool save_finish_op
Definition: ex_docmd.h:29
save_state_T::save_State
int save_State
Definition: ex_docmd.h:27
save_state_T::save_msg_didout
bool save_msg_didout
Definition: ex_docmd.h:26
save_state_T::save_msg_scroll
int save_msg_scroll
Definition: ex_docmd.h:24
funcs.h
ucmd
Definition: ex_docmd.h:36