menu.h
Go to the documentation of this file.
1 #ifndef NVIM_MENU_H
2 #define NVIM_MENU_H
3 
4 #include <stdbool.h> // for bool
5 
6 #include "nvim/types.h" // for char_u and expand_T
7 #include "nvim/ex_cmds_defs.h" // for exarg_T
8 
12 #define MENU_INDEX_INVALID -1
13 #define MENU_INDEX_NORMAL 0
14 #define MENU_INDEX_VISUAL 1
15 #define MENU_INDEX_SELECT 2
16 #define MENU_INDEX_OP_PENDING 3
17 #define MENU_INDEX_INSERT 4
18 #define MENU_INDEX_CMDLINE 5
19 #define MENU_INDEX_TIP 6
20 #define MENU_MODES 7
21 
27 #define MENU_NORMAL_MODE (1 << MENU_INDEX_NORMAL)
28 #define MENU_VISUAL_MODE (1 << MENU_INDEX_VISUAL)
29 #define MENU_SELECT_MODE (1 << MENU_INDEX_SELECT)
30 #define MENU_OP_PENDING_MODE (1 << MENU_INDEX_OP_PENDING)
31 #define MENU_INSERT_MODE (1 << MENU_INDEX_INSERT)
32 #define MENU_CMDLINE_MODE (1 << MENU_INDEX_CMDLINE)
33 #define MENU_TIP_MODE (1 << MENU_INDEX_TIP)
34 #define MENU_ALL_MODES ((1 << MENU_INDEX_TIP) - 1)
35 
38 #define MNU_HIDDEN_CHAR ']'
39 
40 typedef struct VimMenu vimmenu_T;
41 
42 struct VimMenu {
43  int modes;
44  int enabled;
48  char_u *en_dname;
50  int mnemonic;
52  long priority;
59 };
60 
61 
62 #ifdef INCLUDE_GENERATED_DECLARATIONS
63 # include "menu.h.generated.h"
64 #endif
65 #endif // NVIM_MENU_H
vimmenu_T * parent
Parent of menu.
Definition: menu.h:57
char_u * strings[MENU_MODES]
Mapped string for each mode.
Definition: menu.h:53
vimmenu_T * next
Next item in menu.
Definition: menu.h:58
int mnemonic
mnemonic key (after &#39;&&#39;)
Definition: menu.h:50
long priority
Menu order priority.
Definition: menu.h:52
char_u * en_name
Definition: menu.h:47
char_u * name
Name of menu, possibly translated.
Definition: menu.h:45
vimmenu_T * children
Children of sub-menu.
Definition: menu.h:56
int noremap[MENU_MODES]
A REMAP_VALUES flag for each mode.
Definition: menu.h:54
char_u * dname
Displayed Name ("name" without &#39;&&#39;)
Definition: menu.h:46
int modes
Which modes is this menu visible for.
Definition: menu.h:43
int enabled
for which modes the menu is enabled
Definition: menu.h:44
char_u * actext
accelerator text (after TAB)
Definition: menu.h:51
bool silent[MENU_MODES]
A silent flag for each mode.
Definition: menu.h:55
Definition: menu.h:42
unsigned char char_u
Definition: types.h:11
#define MENU_MODES
Definition: menu.h:20
char_u * en_dname
NULL when "dname" untranslated.
Definition: menu.h:49