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