reline 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/BSDL +22 -0
- data/COPYING +56 -0
- data/README.md +9 -0
- data/lib/reline.rb +402 -0
- data/lib/reline/ansi.rb +140 -0
- data/lib/reline/config.rb +286 -0
- data/lib/reline/general_io.rb +67 -0
- data/lib/reline/history.rb +56 -0
- data/lib/reline/key_actor.rb +7 -0
- data/lib/reline/key_actor/base.rb +7 -0
- data/lib/reline/key_actor/emacs.rb +517 -0
- data/lib/reline/key_actor/vi_command.rb +518 -0
- data/lib/reline/key_actor/vi_insert.rb +517 -0
- data/lib/reline/key_stroke.rb +53 -0
- data/lib/reline/kill_ring.rb +113 -0
- data/lib/reline/line_editor.rb +1942 -0
- data/lib/reline/unicode.rb +527 -0
- data/lib/reline/unicode/east_asian_width.rb +1145 -0
- data/lib/reline/version.rb +3 -0
- data/lib/reline/windows.rb +236 -0
- metadata +105 -0
@@ -0,0 +1,517 @@
|
|
1
|
+
class Reline::KeyActor::ViInsert < Reline::KeyActor::Base
|
2
|
+
MAPPING = [
|
3
|
+
# 0 ^@
|
4
|
+
:ed_unassigned,
|
5
|
+
# 1 ^A
|
6
|
+
:ed_insert,
|
7
|
+
# 2 ^B
|
8
|
+
:ed_insert,
|
9
|
+
# 3 ^C
|
10
|
+
:ed_insert,
|
11
|
+
# 4 ^D
|
12
|
+
:vi_list_or_eof,
|
13
|
+
# 5 ^E
|
14
|
+
:ed_insert,
|
15
|
+
# 6 ^F
|
16
|
+
:ed_insert,
|
17
|
+
# 7 ^G
|
18
|
+
:ed_insert,
|
19
|
+
# 8 ^H
|
20
|
+
:vi_delete_prev_char,
|
21
|
+
# 9 ^I
|
22
|
+
:ed_insert,
|
23
|
+
# 10 ^J
|
24
|
+
:ed_newline,
|
25
|
+
# 11 ^K
|
26
|
+
:ed_insert,
|
27
|
+
# 12 ^L
|
28
|
+
:ed_insert,
|
29
|
+
# 13 ^M
|
30
|
+
:ed_newline,
|
31
|
+
# 14 ^N
|
32
|
+
:ed_insert,
|
33
|
+
# 15 ^O
|
34
|
+
:ed_insert,
|
35
|
+
# 16 ^P
|
36
|
+
:ed_insert,
|
37
|
+
# 17 ^Q
|
38
|
+
:ed_ignore,
|
39
|
+
# 18 ^R
|
40
|
+
:ed_search_prev_history,
|
41
|
+
# 19 ^S
|
42
|
+
:ed_ignore,
|
43
|
+
# 20 ^T
|
44
|
+
:ed_insert,
|
45
|
+
# 21 ^U
|
46
|
+
:vi_kill_line_prev,
|
47
|
+
# 22 ^V
|
48
|
+
:ed_quoted_insert,
|
49
|
+
# 23 ^W
|
50
|
+
:ed_delete_prev_word,
|
51
|
+
# 24 ^X
|
52
|
+
:ed_insert,
|
53
|
+
# 25 ^Y
|
54
|
+
:ed_insert,
|
55
|
+
# 26 ^Z
|
56
|
+
:ed_insert,
|
57
|
+
# 27 ^[
|
58
|
+
:vi_command_mode,
|
59
|
+
# 28 ^\
|
60
|
+
:ed_ignore,
|
61
|
+
# 29 ^]
|
62
|
+
:ed_insert,
|
63
|
+
# 30 ^^
|
64
|
+
:ed_insert,
|
65
|
+
# 31 ^_
|
66
|
+
:ed_insert,
|
67
|
+
# 32 SPACE
|
68
|
+
:ed_insert,
|
69
|
+
# 33 !
|
70
|
+
:ed_insert,
|
71
|
+
# 34 "
|
72
|
+
:ed_insert,
|
73
|
+
# 35 #
|
74
|
+
:ed_insert,
|
75
|
+
# 36 $
|
76
|
+
:ed_insert,
|
77
|
+
# 37 %
|
78
|
+
:ed_insert,
|
79
|
+
# 38 &
|
80
|
+
:ed_insert,
|
81
|
+
# 39 '
|
82
|
+
:ed_insert,
|
83
|
+
# 40 (
|
84
|
+
:ed_insert,
|
85
|
+
# 41 )
|
86
|
+
:ed_insert,
|
87
|
+
# 42 *
|
88
|
+
:ed_insert,
|
89
|
+
# 43 +
|
90
|
+
:ed_insert,
|
91
|
+
# 44 ,
|
92
|
+
:ed_insert,
|
93
|
+
# 45 -
|
94
|
+
:ed_insert,
|
95
|
+
# 46 .
|
96
|
+
:ed_insert,
|
97
|
+
# 47 /
|
98
|
+
:ed_insert,
|
99
|
+
# 48 0
|
100
|
+
:ed_insert,
|
101
|
+
# 49 1
|
102
|
+
:ed_insert,
|
103
|
+
# 50 2
|
104
|
+
:ed_insert,
|
105
|
+
# 51 3
|
106
|
+
:ed_insert,
|
107
|
+
# 52 4
|
108
|
+
:ed_insert,
|
109
|
+
# 53 5
|
110
|
+
:ed_insert,
|
111
|
+
# 54 6
|
112
|
+
:ed_insert,
|
113
|
+
# 55 7
|
114
|
+
:ed_insert,
|
115
|
+
# 56 8
|
116
|
+
:ed_insert,
|
117
|
+
# 57 9
|
118
|
+
:ed_insert,
|
119
|
+
# 58 :
|
120
|
+
:ed_insert,
|
121
|
+
# 59 ;
|
122
|
+
:ed_insert,
|
123
|
+
# 60 <
|
124
|
+
:ed_insert,
|
125
|
+
# 61 =
|
126
|
+
:ed_insert,
|
127
|
+
# 62 >
|
128
|
+
:ed_insert,
|
129
|
+
# 63 ?
|
130
|
+
:ed_insert,
|
131
|
+
# 64 @
|
132
|
+
:ed_insert,
|
133
|
+
# 65 A
|
134
|
+
:ed_insert,
|
135
|
+
# 66 B
|
136
|
+
:ed_insert,
|
137
|
+
# 67 C
|
138
|
+
:ed_insert,
|
139
|
+
# 68 D
|
140
|
+
:ed_insert,
|
141
|
+
# 69 E
|
142
|
+
:ed_insert,
|
143
|
+
# 70 F
|
144
|
+
:ed_insert,
|
145
|
+
# 71 G
|
146
|
+
:ed_insert,
|
147
|
+
# 72 H
|
148
|
+
:ed_insert,
|
149
|
+
# 73 I
|
150
|
+
:ed_insert,
|
151
|
+
# 74 J
|
152
|
+
:ed_insert,
|
153
|
+
# 75 K
|
154
|
+
:ed_insert,
|
155
|
+
# 76 L
|
156
|
+
:ed_insert,
|
157
|
+
# 77 M
|
158
|
+
:ed_insert,
|
159
|
+
# 78 N
|
160
|
+
:ed_insert,
|
161
|
+
# 79 O
|
162
|
+
:ed_insert,
|
163
|
+
# 80 P
|
164
|
+
:ed_insert,
|
165
|
+
# 81 Q
|
166
|
+
:ed_insert,
|
167
|
+
# 82 R
|
168
|
+
:ed_insert,
|
169
|
+
# 83 S
|
170
|
+
:ed_insert,
|
171
|
+
# 84 T
|
172
|
+
:ed_insert,
|
173
|
+
# 85 U
|
174
|
+
:ed_insert,
|
175
|
+
# 86 V
|
176
|
+
:ed_insert,
|
177
|
+
# 87 W
|
178
|
+
:ed_insert,
|
179
|
+
# 88 X
|
180
|
+
:ed_insert,
|
181
|
+
# 89 Y
|
182
|
+
:ed_insert,
|
183
|
+
# 90 Z
|
184
|
+
:ed_insert,
|
185
|
+
# 91 [
|
186
|
+
:ed_insert,
|
187
|
+
# 92 \
|
188
|
+
:ed_insert,
|
189
|
+
# 93 ]
|
190
|
+
:ed_insert,
|
191
|
+
# 94 ^
|
192
|
+
:ed_insert,
|
193
|
+
# 95 _
|
194
|
+
:ed_insert,
|
195
|
+
# 96 `
|
196
|
+
:ed_insert,
|
197
|
+
# 97 a
|
198
|
+
:ed_insert,
|
199
|
+
# 98 b
|
200
|
+
:ed_insert,
|
201
|
+
# 99 c
|
202
|
+
:ed_insert,
|
203
|
+
# 100 d
|
204
|
+
:ed_insert,
|
205
|
+
# 101 e
|
206
|
+
:ed_insert,
|
207
|
+
# 102 f
|
208
|
+
:ed_insert,
|
209
|
+
# 103 g
|
210
|
+
:ed_insert,
|
211
|
+
# 104 h
|
212
|
+
:ed_insert,
|
213
|
+
# 105 i
|
214
|
+
:ed_insert,
|
215
|
+
# 106 j
|
216
|
+
:ed_insert,
|
217
|
+
# 107 k
|
218
|
+
:ed_insert,
|
219
|
+
# 108 l
|
220
|
+
:ed_insert,
|
221
|
+
# 109 m
|
222
|
+
:ed_insert,
|
223
|
+
# 110 n
|
224
|
+
:ed_insert,
|
225
|
+
# 111 o
|
226
|
+
:ed_insert,
|
227
|
+
# 112 p
|
228
|
+
:ed_insert,
|
229
|
+
# 113 q
|
230
|
+
:ed_insert,
|
231
|
+
# 114 r
|
232
|
+
:ed_insert,
|
233
|
+
# 115 s
|
234
|
+
:ed_insert,
|
235
|
+
# 116 t
|
236
|
+
:ed_insert,
|
237
|
+
# 117 u
|
238
|
+
:ed_insert,
|
239
|
+
# 118 v
|
240
|
+
:ed_insert,
|
241
|
+
# 119 w
|
242
|
+
:ed_insert,
|
243
|
+
# 120 x
|
244
|
+
:ed_insert,
|
245
|
+
# 121 y
|
246
|
+
:ed_insert,
|
247
|
+
# 122 z
|
248
|
+
:ed_insert,
|
249
|
+
# 123 {
|
250
|
+
:ed_insert,
|
251
|
+
# 124 |
|
252
|
+
:ed_insert,
|
253
|
+
# 125 }
|
254
|
+
:ed_insert,
|
255
|
+
# 126 ~
|
256
|
+
:ed_insert,
|
257
|
+
# 127 ^?
|
258
|
+
:vi_delete_prev_char,
|
259
|
+
# 128 M-^@
|
260
|
+
:ed_unassigned,
|
261
|
+
# 129 M-^A
|
262
|
+
:ed_unassigned,
|
263
|
+
# 130 M-^B
|
264
|
+
:ed_unassigned,
|
265
|
+
# 131 M-^C
|
266
|
+
:ed_unassigned,
|
267
|
+
# 132 M-^D
|
268
|
+
:ed_unassigned,
|
269
|
+
# 133 M-^E
|
270
|
+
:ed_unassigned,
|
271
|
+
# 134 M-^F
|
272
|
+
:ed_unassigned,
|
273
|
+
# 135 M-^G
|
274
|
+
:ed_unassigned,
|
275
|
+
# 136 M-^H
|
276
|
+
:ed_unassigned,
|
277
|
+
# 137 M-^I
|
278
|
+
:ed_unassigned,
|
279
|
+
# 138 M-^J
|
280
|
+
:key_newline,
|
281
|
+
# 139 M-^K
|
282
|
+
:ed_unassigned,
|
283
|
+
# 140 M-^L
|
284
|
+
:ed_unassigned,
|
285
|
+
# 141 M-^M
|
286
|
+
:key_newline,
|
287
|
+
# 142 M-^N
|
288
|
+
:ed_unassigned,
|
289
|
+
# 143 M-^O
|
290
|
+
:ed_unassigned,
|
291
|
+
# 144 M-^P
|
292
|
+
:ed_unassigned,
|
293
|
+
# 145 M-^Q
|
294
|
+
:ed_unassigned,
|
295
|
+
# 146 M-^R
|
296
|
+
:ed_unassigned,
|
297
|
+
# 147 M-^S
|
298
|
+
:ed_unassigned,
|
299
|
+
# 148 M-^T
|
300
|
+
:ed_unassigned,
|
301
|
+
# 149 M-^U
|
302
|
+
:ed_unassigned,
|
303
|
+
# 150 M-^V
|
304
|
+
:ed_unassigned,
|
305
|
+
# 151 M-^W
|
306
|
+
:ed_unassigned,
|
307
|
+
# 152 M-^X
|
308
|
+
:ed_unassigned,
|
309
|
+
# 153 M-^Y
|
310
|
+
:ed_unassigned,
|
311
|
+
# 154 M-^Z
|
312
|
+
:ed_unassigned,
|
313
|
+
# 155 M-^[
|
314
|
+
:ed_unassigned,
|
315
|
+
# 156 M-^\
|
316
|
+
:ed_unassigned,
|
317
|
+
# 157 M-^]
|
318
|
+
:ed_unassigned,
|
319
|
+
# 158 M-^^
|
320
|
+
:ed_unassigned,
|
321
|
+
# 159 M-^_
|
322
|
+
:ed_unassigned,
|
323
|
+
# 160 M-SPACE
|
324
|
+
:ed_unassigned,
|
325
|
+
# 161 M-!
|
326
|
+
:ed_unassigned,
|
327
|
+
# 162 M-"
|
328
|
+
:ed_unassigned,
|
329
|
+
# 163 M-#
|
330
|
+
:ed_unassigned,
|
331
|
+
# 164 M-$
|
332
|
+
:ed_unassigned,
|
333
|
+
# 165 M-%
|
334
|
+
:ed_unassigned,
|
335
|
+
# 166 M-&
|
336
|
+
:ed_unassigned,
|
337
|
+
# 167 M-'
|
338
|
+
:ed_unassigned,
|
339
|
+
# 168 M-(
|
340
|
+
:ed_unassigned,
|
341
|
+
# 169 M-)
|
342
|
+
:ed_unassigned,
|
343
|
+
# 170 M-*
|
344
|
+
:ed_unassigned,
|
345
|
+
# 171 M-+
|
346
|
+
:ed_unassigned,
|
347
|
+
# 172 M-,
|
348
|
+
:ed_unassigned,
|
349
|
+
# 173 M--
|
350
|
+
:ed_unassigned,
|
351
|
+
# 174 M-.
|
352
|
+
:ed_unassigned,
|
353
|
+
# 175 M-/
|
354
|
+
:ed_unassigned,
|
355
|
+
# 176 M-0
|
356
|
+
:ed_unassigned,
|
357
|
+
# 177 M-1
|
358
|
+
:ed_unassigned,
|
359
|
+
# 178 M-2
|
360
|
+
:ed_unassigned,
|
361
|
+
# 179 M-3
|
362
|
+
:ed_unassigned,
|
363
|
+
# 180 M-4
|
364
|
+
:ed_unassigned,
|
365
|
+
# 181 M-5
|
366
|
+
:ed_unassigned,
|
367
|
+
# 182 M-6
|
368
|
+
:ed_unassigned,
|
369
|
+
# 183 M-7
|
370
|
+
:ed_unassigned,
|
371
|
+
# 184 M-8
|
372
|
+
:ed_unassigned,
|
373
|
+
# 185 M-9
|
374
|
+
:ed_unassigned,
|
375
|
+
# 186 M-:
|
376
|
+
:ed_unassigned,
|
377
|
+
# 187 M-;
|
378
|
+
:ed_unassigned,
|
379
|
+
# 188 M-<
|
380
|
+
:ed_unassigned,
|
381
|
+
# 189 M-=
|
382
|
+
:ed_unassigned,
|
383
|
+
# 190 M->
|
384
|
+
:ed_unassigned,
|
385
|
+
# 191 M-?
|
386
|
+
:ed_unassigned,
|
387
|
+
# 192 M-@
|
388
|
+
:ed_unassigned,
|
389
|
+
# 193 M-A
|
390
|
+
:ed_unassigned,
|
391
|
+
# 194 M-B
|
392
|
+
:ed_unassigned,
|
393
|
+
# 195 M-C
|
394
|
+
:ed_unassigned,
|
395
|
+
# 196 M-D
|
396
|
+
:ed_unassigned,
|
397
|
+
# 197 M-E
|
398
|
+
:ed_unassigned,
|
399
|
+
# 198 M-F
|
400
|
+
:ed_unassigned,
|
401
|
+
# 199 M-G
|
402
|
+
:ed_unassigned,
|
403
|
+
# 200 M-H
|
404
|
+
:ed_unassigned,
|
405
|
+
# 201 M-I
|
406
|
+
:ed_unassigned,
|
407
|
+
# 202 M-J
|
408
|
+
:ed_unassigned,
|
409
|
+
# 203 M-K
|
410
|
+
:ed_unassigned,
|
411
|
+
# 204 M-L
|
412
|
+
:ed_unassigned,
|
413
|
+
# 205 M-M
|
414
|
+
:ed_unassigned,
|
415
|
+
# 206 M-N
|
416
|
+
:ed_unassigned,
|
417
|
+
# 207 M-O
|
418
|
+
:ed_unassigned,
|
419
|
+
# 208 M-P
|
420
|
+
:ed_unassigned,
|
421
|
+
# 209 M-Q
|
422
|
+
:ed_unassigned,
|
423
|
+
# 210 M-R
|
424
|
+
:ed_unassigned,
|
425
|
+
# 211 M-S
|
426
|
+
:ed_unassigned,
|
427
|
+
# 212 M-T
|
428
|
+
:ed_unassigned,
|
429
|
+
# 213 M-U
|
430
|
+
:ed_unassigned,
|
431
|
+
# 214 M-V
|
432
|
+
:ed_unassigned,
|
433
|
+
# 215 M-W
|
434
|
+
:ed_unassigned,
|
435
|
+
# 216 M-X
|
436
|
+
:ed_unassigned,
|
437
|
+
# 217 M-Y
|
438
|
+
:ed_unassigned,
|
439
|
+
# 218 M-Z
|
440
|
+
:ed_unassigned,
|
441
|
+
# 219 M-[
|
442
|
+
:ed_unassigned,
|
443
|
+
# 220 M-\
|
444
|
+
:ed_unassigned,
|
445
|
+
# 221 M-]
|
446
|
+
:ed_unassigned,
|
447
|
+
# 222 M-^
|
448
|
+
:ed_unassigned,
|
449
|
+
# 223 M-_
|
450
|
+
:ed_unassigned,
|
451
|
+
# 224 M-`
|
452
|
+
:ed_unassigned,
|
453
|
+
# 225 M-a
|
454
|
+
:ed_unassigned,
|
455
|
+
# 226 M-b
|
456
|
+
:ed_unassigned,
|
457
|
+
# 227 M-c
|
458
|
+
:ed_unassigned,
|
459
|
+
# 228 M-d
|
460
|
+
:ed_unassigned,
|
461
|
+
# 229 M-e
|
462
|
+
:ed_unassigned,
|
463
|
+
# 230 M-f
|
464
|
+
:ed_unassigned,
|
465
|
+
# 231 M-g
|
466
|
+
:ed_unassigned,
|
467
|
+
# 232 M-h
|
468
|
+
:ed_unassigned,
|
469
|
+
# 233 M-i
|
470
|
+
:ed_unassigned,
|
471
|
+
# 234 M-j
|
472
|
+
:ed_unassigned,
|
473
|
+
# 235 M-k
|
474
|
+
:ed_unassigned,
|
475
|
+
# 236 M-l
|
476
|
+
:ed_unassigned,
|
477
|
+
# 237 M-m
|
478
|
+
:ed_unassigned,
|
479
|
+
# 238 M-n
|
480
|
+
:ed_unassigned,
|
481
|
+
# 239 M-o
|
482
|
+
:ed_unassigned,
|
483
|
+
# 240 M-p
|
484
|
+
:ed_unassigned,
|
485
|
+
# 241 M-q
|
486
|
+
:ed_unassigned,
|
487
|
+
# 242 M-r
|
488
|
+
:ed_unassigned,
|
489
|
+
# 243 M-s
|
490
|
+
:ed_unassigned,
|
491
|
+
# 244 M-t
|
492
|
+
:ed_unassigned,
|
493
|
+
# 245 M-u
|
494
|
+
:ed_unassigned,
|
495
|
+
# 246 M-v
|
496
|
+
:ed_unassigned,
|
497
|
+
# 247 M-w
|
498
|
+
:ed_unassigned,
|
499
|
+
# 248 M-x
|
500
|
+
:ed_unassigned,
|
501
|
+
# 249 M-y
|
502
|
+
:ed_unassigned,
|
503
|
+
# 250 M-z
|
504
|
+
:ed_unassigned,
|
505
|
+
# 251 M-{
|
506
|
+
:ed_unassigned,
|
507
|
+
# 252 M-|
|
508
|
+
:ed_unassigned,
|
509
|
+
# 253 M-}
|
510
|
+
:ed_unassigned,
|
511
|
+
# 254 M-~
|
512
|
+
:ed_unassigned,
|
513
|
+
# 255 M-^?
|
514
|
+
:ed_unassigned
|
515
|
+
# EOF
|
516
|
+
]
|
517
|
+
end
|