Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-src
Path: blob/main/contrib/less/cmd.h
39476 views
1
/*
2
* Copyright (C) 1984-2025 Mark Nudelman
3
*
4
* You may distribute under the terms of either the GNU General Public
5
* License or the Less License, as specified in the README file.
6
*
7
* For more information, see the README file.
8
*/
9
10
11
#define MAX_USERCMD 1000
12
#define MAX_CMDLEN 16
13
14
#define A_B_LINE 2
15
#define A_B_SCREEN 3
16
#define A_B_SCROLL 4
17
#define A_B_SEARCH 5
18
#define A_DIGIT 6
19
#define A_DISP_OPTION 7
20
#define A_DEBUG 8
21
#define A_EXAMINE 9
22
#define A_FIRSTCMD 10
23
#define A_FREPAINT 11
24
#define A_F_LINE 12
25
#define A_F_SCREEN 13
26
#define A_F_SCROLL 14
27
#define A_F_SEARCH 15
28
#define A_GOEND 16
29
#define A_GOLINE 17
30
#define A_GOMARK 18
31
#define A_HELP 19
32
#define A_NEXT_FILE 20
33
#define A_PERCENT 21
34
#define A_BF_SCREEN 22
35
#define A_PREV_FILE 23
36
#define A_QUIT 24
37
#define A_REPAINT 25
38
#define A_SETMARK 26
39
#define A_SHELL 27
40
#define A_STAT 28
41
#define A_FF_LINE 29
42
#define A_BF_LINE 30
43
#define A_VERSION 31
44
#define A_VISUAL 32
45
#define A_F_WINDOW 33
46
#define A_B_WINDOW 34
47
#define A_F_BRACKET 35
48
#define A_B_BRACKET 36
49
#define A_PIPE 37
50
#define A_INDEX_FILE 38
51
#define A_UNDO_SEARCH 39
52
#define A_FF_SCREEN 40
53
#define A_LSHIFT 41
54
#define A_RSHIFT 42
55
#define A_AGAIN_SEARCH 43
56
#define A_T_AGAIN_SEARCH 44
57
#define A_REVERSE_SEARCH 45
58
#define A_T_REVERSE_SEARCH 46
59
#define A_OPT_TOGGLE 47
60
#define A_OPT_SET 48
61
#define A_OPT_UNSET 49
62
#define A_F_FOREVER 50
63
#define A_GOPOS 51
64
#define A_REMOVE_FILE 52
65
#define A_NEXT_TAG 53
66
#define A_PREV_TAG 54
67
#define A_FILTER 55
68
#define A_F_UNTIL_HILITE 56
69
#define A_GOEND_BUF 57
70
#define A_LLSHIFT 58
71
#define A_RRSHIFT 59
72
#define A_F_NEWLINE 60
73
#define A_B_NEWLINE 61
74
#define A_CLRMARK 62
75
#define A_SETMARKBOT 63
76
#define A_X11MOUSE_IN 64
77
#define A_F_MOUSE 66
78
#define A_B_MOUSE 67
79
/* Note "X116" refers to extended (1006) X11 mouse reporting. */
80
#define A_X116MOUSE_IN 68
81
#define A_PSHELL 69
82
#define A_CLR_SEARCH 70
83
#define A_OSC8_F_SEARCH 71
84
#define A_OSC8_B_SEARCH 72
85
#define A_OSC8_OPEN 73
86
#define A_OSC8_JUMP 74
87
#define A_START_PASTE 75 /* must not overlap EC_* */
88
#define A_END_PASTE 76 /* must not overlap EC_* */
89
90
/* These values must not conflict with any A_* or EC_* value. */
91
#define A_INVALID 100
92
#define A_NOACTION 101
93
#define A_UINVALID 102
94
#define A_END_LIST 103
95
#define A_SPECIAL_KEY 104
96
#define A_PREFIX 105
97
#define A_SKIP 127
98
99
#define A_EXTRA 0200
100
101
102
/* Line editing characters */
103
104
#define EC_BACKSPACE 1
105
#define EC_LINEKILL 2
106
#define EC_RIGHT 3
107
#define EC_LEFT 4
108
#define EC_W_LEFT 5
109
#define EC_W_RIGHT 6
110
#define EC_INSERT 7
111
#define EC_DELETE 8
112
#define EC_HOME 9
113
#define EC_END 10
114
#define EC_W_BACKSPACE 11
115
#define EC_W_DELETE 12
116
#define EC_UP 13
117
#define EC_DOWN 14
118
#define EC_EXPAND 15
119
#define EC_F_COMPLETE 17
120
#define EC_B_COMPLETE 18
121
#define EC_LITERAL 19
122
#define EC_ABORT 20
123
#define EC_X11MOUSE 21
124
#define EC_X116MOUSE 22
125
#define EC_START_PASTE A_START_PASTE
126
#define EC_END_PASTE A_END_PASTE
127
128
#define EC_UINVALID 102
129
130
/* Flags for editchar() */
131
#define ECF_PEEK 01
132
#define ECF_NOHISTORY 02
133
#define ECF_NOCOMPLETE 04
134
#define ECF_NORIGHTLEFT 010
135
136
/* Environment variable stuff */
137
#define EV_OK 01
138
139
/* Special keys (keys which output different strings on different terminals) */
140
#define SK_SPECIAL_KEY CONTROL('K')
141
#define SK_RIGHT_ARROW 1
142
#define SK_LEFT_ARROW 2
143
#define SK_UP_ARROW 3
144
#define SK_DOWN_ARROW 4
145
#define SK_PAGE_UP 5
146
#define SK_PAGE_DOWN 6
147
#define SK_HOME 7
148
#define SK_END 8
149
#define SK_DELETE 9
150
#define SK_INSERT 10
151
#define SK_CTL_LEFT_ARROW 11
152
#define SK_CTL_RIGHT_ARROW 12
153
#define SK_CTL_DELETE 13
154
#define SK_F1 14
155
#define SK_BACKTAB 15
156
#define SK_CTL_BACKSPACE 16
157
#define SK_BACKSPACE 17
158
#define SK_CONTROL_K 40
159
160