Neovim Home
src
nvim
getchar.h
Go to the documentation of this file.
1
#ifndef NVIM_GETCHAR_H
2
#define NVIM_GETCHAR_H
3
4
#include "
nvim/buffer_defs.h
"
5
#include "
nvim/ex_cmds_defs.h
"
6
#include "
nvim/os/fileio.h
"
7
#include "
nvim/types.h
"
8
#include "
nvim/vim.h
"
9
13
enum
RemapValues
{
14
REMAP_YES
= 0,
15
REMAP_NONE
= -1,
16
REMAP_SCRIPT
= -2,
17
REMAP_SKIP
= -3,
18
};
19
20
// Argument for flush_buffers().
21
typedef
enum
{
22
FLUSH_MINIMAL
,
23
FLUSH_TYPEAHEAD
,
// flush current typebuf contents
24
FLUSH_INPUT
,
// flush typebuf and inchar() input
25
}
flush_buffers_T
;
26
34
struct
map_arguments
{
35
bool
buffer
;
36
bool
expr
;
37
bool
noremap
;
38
bool
nowait
;
39
bool
script
;
40
bool
silent
;
41
bool
unique
;
42
48
char_u
lhs
[
MAXMAPLEN
+ 1];
49
size_t
lhs_len
;
50
52
char_u
alt_lhs
[
MAXMAPLEN
+ 1];
53
size_t
alt_lhs_len
;
54
55
char_u
*
rhs
;
56
size_t
rhs_len
;
57
LuaRef
rhs_lua
;
58
bool
rhs_is_noop
;
59
60
char_u
*
orig_rhs
;
61
size_t
orig_rhs_len
;
62
char
*
desc
;
63
};
64
typedef
struct
map_arguments
MapArguments
;
65
#define MAP_ARGUMENTS_INIT { false, false, false, false, false, false, false, \
66
{ 0 }, 0, { 0 }, 0, NULL, 0, LUA_NOREF, false, NULL, 0, NULL }
67
68
#define KEYLEN_PART_KEY (-1) // keylen value for incomplete key-code
69
#define KEYLEN_PART_MAP (-2) // keylen value for incomplete mapping
70
72
enum
{
NSCRIPT
= 15, };
73
75
extern
FileDescriptor
*
scriptin
[
NSCRIPT
];
76
77
#ifdef INCLUDE_GENERATED_DECLARATIONS
78
# include "getchar.h.generated.h"
79
#endif
80
#endif // NVIM_GETCHAR_H
map_arguments::desc
char * desc
Definition:
getchar.h:62
map_arguments
Definition:
getchar.h:34
map_arguments::rhs_lua
LuaRef rhs_lua
Definition:
getchar.h:57
NSCRIPT
@ NSCRIPT
Definition:
getchar.h:72
REMAP_SKIP
@ REMAP_SKIP
No remapping for first char.
Definition:
getchar.h:17
types.h
REMAP_SCRIPT
@ REMAP_SCRIPT
Remap script-local mappings only.
Definition:
getchar.h:16
map_arguments::lhs
char_u lhs[MAXMAPLEN+1]
Definition:
getchar.h:48
RemapValues
RemapValues
Definition:
getchar.h:13
FileDescriptor
Structure used to read from/write to file.
Definition:
fileio.h:11
map_arguments::alt_lhs_len
size_t alt_lhs_len
Definition:
getchar.h:53
FLUSH_TYPEAHEAD
@ FLUSH_TYPEAHEAD
Definition:
getchar.h:23
map_arguments::rhs_len
size_t rhs_len
The {rhs} of the mapping.
Definition:
getchar.h:56
MAXMAPLEN
#define MAXMAPLEN
Definition:
vim.h:206
LuaRef
int LuaRef
Definition:
types.h:23
map_arguments::silent
bool silent
Definition:
getchar.h:40
map_arguments::alt_lhs
char_u alt_lhs[MAXMAPLEN+1]
Unsimplifed {lhs} of the mapping. If no simplification has been done then alt_lhs_len is 0.
Definition:
getchar.h:52
scriptin
FileDescriptor * scriptin[NSCRIPT]
Streams to read script from.
Definition:
getchar.c:60
map_arguments::nowait
bool nowait
Definition:
getchar.h:38
map_arguments::orig_rhs
char_u * orig_rhs
True when the {orig_rhs} is <nop>.
Definition:
getchar.h:60
map_arguments::lhs_len
size_t lhs_len
Definition:
getchar.h:49
REMAP_YES
@ REMAP_YES
Allow remapping.
Definition:
getchar.h:14
fileio.h
REMAP_NONE
@ REMAP_NONE
No remapping.
Definition:
getchar.h:15
char_u
unsigned char char_u
Definition:
types.h:12
ex_cmds_defs.h
map_arguments::script
bool script
Definition:
getchar.h:39
map_arguments::buffer
bool buffer
Definition:
getchar.h:35
buffer_defs.h
FLUSH_MINIMAL
@ FLUSH_MINIMAL
Definition:
getchar.h:22
vim.h
map_arguments::noremap
bool noremap
Definition:
getchar.h:37
FLUSH_INPUT
@ FLUSH_INPUT
Definition:
getchar.h:24
map_arguments::orig_rhs_len
size_t orig_rhs_len
The original text of the {rhs}.
Definition:
getchar.h:61
map_arguments::rhs
char_u * rhs
Definition:
getchar.h:55
map_arguments::unique
bool unique
Definition:
getchar.h:41
flush_buffers_T
flush_buffers_T
Definition:
getchar.h:21
map_arguments::rhs_is_noop
bool rhs_is_noop
lua function as rhs
Definition:
getchar.h:58
map_arguments::expr
bool expr
Definition:
getchar.h:36