reline 0.3.9 → 0.5.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -1
- data/lib/reline/ansi.rb +38 -39
- data/lib/reline/config.rb +35 -56
- data/lib/reline/face.rb +199 -0
- data/lib/reline/general_io.rb +4 -9
- data/lib/reline/history.rb +1 -1
- data/lib/reline/key_actor/base.rb +0 -4
- data/lib/reline/key_actor/emacs.rb +13 -13
- data/lib/reline/key_actor/vi_command.rb +23 -23
- data/lib/reline/key_actor/vi_insert.rb +5 -5
- data/lib/reline/kill_ring.rb +2 -2
- data/lib/reline/line_editor.rb +1038 -1784
- data/lib/reline/terminfo.rb +7 -14
- data/lib/reline/unicode.rb +66 -12
- data/lib/reline/version.rb +1 -1
- data/lib/reline/windows.rb +4 -2
- data/lib/reline.rb +75 -80
- metadata +8 -4
@@ -19,7 +19,7 @@ class Reline::KeyActor::Emacs < Reline::KeyActor::Base
|
|
19
19
|
# 8 ^H
|
20
20
|
:em_delete_prev_char,
|
21
21
|
# 9 ^I
|
22
|
-
:
|
22
|
+
:complete,
|
23
23
|
# 10 ^J
|
24
24
|
:ed_newline,
|
25
25
|
# 11 ^K
|
@@ -49,13 +49,13 @@ class Reline::KeyActor::Emacs < Reline::KeyActor::Base
|
|
49
49
|
# 23 ^W
|
50
50
|
:em_kill_region,
|
51
51
|
# 24 ^X
|
52
|
-
:
|
52
|
+
:ed_unassigned,
|
53
53
|
# 25 ^Y
|
54
54
|
:em_yank,
|
55
55
|
# 26 ^Z
|
56
56
|
:ed_ignore,
|
57
57
|
# 27 ^[
|
58
|
-
:
|
58
|
+
:ed_unassigned,
|
59
59
|
# 28 ^\
|
60
60
|
:ed_ignore,
|
61
61
|
# 29 ^]
|
@@ -63,7 +63,7 @@ class Reline::KeyActor::Emacs < Reline::KeyActor::Base
|
|
63
63
|
# 30 ^^
|
64
64
|
:ed_unassigned,
|
65
65
|
# 31 ^_
|
66
|
-
:
|
66
|
+
:undo,
|
67
67
|
# 32 SPACE
|
68
68
|
:ed_insert,
|
69
69
|
# 33 !
|
@@ -319,9 +319,9 @@ class Reline::KeyActor::Emacs < Reline::KeyActor::Base
|
|
319
319
|
# 158 M-^^
|
320
320
|
:ed_unassigned,
|
321
321
|
# 159 M-^_
|
322
|
-
:
|
322
|
+
:redo,
|
323
323
|
# 160 M-SPACE
|
324
|
-
:
|
324
|
+
:em_set_mark,
|
325
325
|
# 161 M-!
|
326
326
|
:ed_unassigned,
|
327
327
|
# 162 M-"
|
@@ -415,7 +415,7 @@ class Reline::KeyActor::Emacs < Reline::KeyActor::Base
|
|
415
415
|
# 206 M-N
|
416
416
|
:vi_search_next,
|
417
417
|
# 207 M-O
|
418
|
-
:
|
418
|
+
:ed_unassigned,
|
419
419
|
# 208 M-P
|
420
420
|
:vi_search_prev,
|
421
421
|
# 209 M-Q
|
@@ -431,15 +431,15 @@ class Reline::KeyActor::Emacs < Reline::KeyActor::Base
|
|
431
431
|
# 214 M-V
|
432
432
|
:ed_unassigned,
|
433
433
|
# 215 M-W
|
434
|
-
:
|
434
|
+
:ed_unassigned,
|
435
435
|
# 216 M-X
|
436
|
-
:ed_command,
|
437
|
-
# 217 M-Y
|
438
436
|
:ed_unassigned,
|
437
|
+
# 217 M-Y
|
438
|
+
:em_yank_pop,
|
439
439
|
# 218 M-Z
|
440
440
|
:ed_unassigned,
|
441
441
|
# 219 M-[
|
442
|
-
:
|
442
|
+
:ed_unassigned,
|
443
443
|
# 220 M-\
|
444
444
|
:ed_unassigned,
|
445
445
|
# 221 M-]
|
@@ -495,9 +495,9 @@ class Reline::KeyActor::Emacs < Reline::KeyActor::Base
|
|
495
495
|
# 246 M-v
|
496
496
|
:ed_unassigned,
|
497
497
|
# 247 M-w
|
498
|
-
:
|
498
|
+
:ed_unassigned,
|
499
499
|
# 248 M-x
|
500
|
-
:
|
500
|
+
:ed_unassigned,
|
501
501
|
# 249 M-y
|
502
502
|
:ed_unassigned,
|
503
503
|
# 250 M-z
|
@@ -17,7 +17,7 @@ class Reline::KeyActor::ViCommand < Reline::KeyActor::Base
|
|
17
17
|
# 7 ^G
|
18
18
|
:ed_unassigned,
|
19
19
|
# 8 ^H
|
20
|
-
:
|
20
|
+
:ed_prev_char,
|
21
21
|
# 9 ^I
|
22
22
|
:ed_unassigned,
|
23
23
|
# 10 ^J
|
@@ -41,7 +41,7 @@ class Reline::KeyActor::ViCommand < Reline::KeyActor::Base
|
|
41
41
|
# 19 ^S
|
42
42
|
:ed_ignore,
|
43
43
|
# 20 ^T
|
44
|
-
:
|
44
|
+
:ed_transpose_chars,
|
45
45
|
# 21 ^U
|
46
46
|
:vi_kill_line_prev,
|
47
47
|
# 22 ^V
|
@@ -51,7 +51,7 @@ class Reline::KeyActor::ViCommand < Reline::KeyActor::Base
|
|
51
51
|
# 24 ^X
|
52
52
|
:ed_unassigned,
|
53
53
|
# 25 ^Y
|
54
|
-
:
|
54
|
+
:em_yank,
|
55
55
|
# 26 ^Z
|
56
56
|
:ed_unassigned,
|
57
57
|
# 27 ^[
|
@@ -75,7 +75,7 @@ class Reline::KeyActor::ViCommand < Reline::KeyActor::Base
|
|
75
75
|
# 36 $
|
76
76
|
:ed_move_to_end,
|
77
77
|
# 37 %
|
78
|
-
:
|
78
|
+
:ed_unassigned,
|
79
79
|
# 38 &
|
80
80
|
:ed_unassigned,
|
81
81
|
# 39 '
|
@@ -89,11 +89,11 @@ class Reline::KeyActor::ViCommand < Reline::KeyActor::Base
|
|
89
89
|
# 43 +
|
90
90
|
:ed_next_history,
|
91
91
|
# 44 ,
|
92
|
-
:
|
92
|
+
:ed_unassigned,
|
93
93
|
# 45 -
|
94
94
|
:ed_prev_history,
|
95
95
|
# 46 .
|
96
|
-
:
|
96
|
+
:ed_unassigned,
|
97
97
|
# 47 /
|
98
98
|
:vi_search_prev,
|
99
99
|
# 48 0
|
@@ -117,9 +117,9 @@ class Reline::KeyActor::ViCommand < Reline::KeyActor::Base
|
|
117
117
|
# 57 9
|
118
118
|
:ed_argument_digit,
|
119
119
|
# 58 :
|
120
|
-
:
|
120
|
+
:ed_unassigned,
|
121
121
|
# 59 ;
|
122
|
-
:
|
122
|
+
:ed_unassigned,
|
123
123
|
# 60 <
|
124
124
|
:ed_unassigned,
|
125
125
|
# 61 =
|
@@ -157,21 +157,21 @@ class Reline::KeyActor::ViCommand < Reline::KeyActor::Base
|
|
157
157
|
# 77 M
|
158
158
|
:ed_unassigned,
|
159
159
|
# 78 N
|
160
|
-
:
|
160
|
+
:ed_unassigned,
|
161
161
|
# 79 O
|
162
|
-
:
|
162
|
+
:ed_unassigned,
|
163
163
|
# 80 P
|
164
164
|
:vi_paste_prev,
|
165
165
|
# 81 Q
|
166
166
|
:ed_unassigned,
|
167
167
|
# 82 R
|
168
|
-
:
|
168
|
+
:ed_unassigned,
|
169
169
|
# 83 S
|
170
|
-
:
|
170
|
+
:ed_unassigned,
|
171
171
|
# 84 T
|
172
172
|
:vi_to_prev_char,
|
173
173
|
# 85 U
|
174
|
-
:
|
174
|
+
:ed_unassigned,
|
175
175
|
# 86 V
|
176
176
|
:ed_unassigned,
|
177
177
|
# 87 W
|
@@ -179,11 +179,11 @@ class Reline::KeyActor::ViCommand < Reline::KeyActor::Base
|
|
179
179
|
# 88 X
|
180
180
|
:ed_delete_prev_char,
|
181
181
|
# 89 Y
|
182
|
-
:
|
182
|
+
:ed_unassigned,
|
183
183
|
# 90 Z
|
184
184
|
:ed_unassigned,
|
185
185
|
# 91 [
|
186
|
-
:
|
186
|
+
:ed_unassigned,
|
187
187
|
# 92 \
|
188
188
|
:ed_unassigned,
|
189
189
|
# 93 ]
|
@@ -191,7 +191,7 @@ class Reline::KeyActor::ViCommand < Reline::KeyActor::Base
|
|
191
191
|
# 94 ^
|
192
192
|
:vi_first_print,
|
193
193
|
# 95 _
|
194
|
-
:
|
194
|
+
:ed_unassigned,
|
195
195
|
# 96 `
|
196
196
|
:ed_unassigned,
|
197
197
|
# 97 a
|
@@ -221,7 +221,7 @@ class Reline::KeyActor::ViCommand < Reline::KeyActor::Base
|
|
221
221
|
# 109 m
|
222
222
|
:ed_unassigned,
|
223
223
|
# 110 n
|
224
|
-
:
|
224
|
+
:ed_unassigned,
|
225
225
|
# 111 o
|
226
226
|
:ed_unassigned,
|
227
227
|
# 112 p
|
@@ -231,11 +231,11 @@ class Reline::KeyActor::ViCommand < Reline::KeyActor::Base
|
|
231
231
|
# 114 r
|
232
232
|
:vi_replace_char,
|
233
233
|
# 115 s
|
234
|
-
:
|
234
|
+
:ed_unassigned,
|
235
235
|
# 116 t
|
236
236
|
:vi_to_next_char,
|
237
237
|
# 117 u
|
238
|
-
:
|
238
|
+
:ed_unassigned,
|
239
239
|
# 118 v
|
240
240
|
:vi_histedit,
|
241
241
|
# 119 w
|
@@ -253,9 +253,9 @@ class Reline::KeyActor::ViCommand < Reline::KeyActor::Base
|
|
253
253
|
# 125 }
|
254
254
|
:ed_unassigned,
|
255
255
|
# 126 ~
|
256
|
-
:vi_change_case,
|
257
|
-
# 127 ^?
|
258
256
|
:ed_unassigned,
|
257
|
+
# 127 ^?
|
258
|
+
:em_delete_prev_char,
|
259
259
|
# 128 M-^@
|
260
260
|
:ed_unassigned,
|
261
261
|
# 129 M-^A
|
@@ -415,7 +415,7 @@ class Reline::KeyActor::ViCommand < Reline::KeyActor::Base
|
|
415
415
|
# 206 M-N
|
416
416
|
:ed_unassigned,
|
417
417
|
# 207 M-O
|
418
|
-
:
|
418
|
+
:ed_unassigned,
|
419
419
|
# 208 M-P
|
420
420
|
:ed_unassigned,
|
421
421
|
# 209 M-Q
|
@@ -439,7 +439,7 @@ class Reline::KeyActor::ViCommand < Reline::KeyActor::Base
|
|
439
439
|
# 218 M-Z
|
440
440
|
:ed_unassigned,
|
441
441
|
# 219 M-[
|
442
|
-
:
|
442
|
+
:ed_unassigned,
|
443
443
|
# 220 M-\
|
444
444
|
:ed_unassigned,
|
445
445
|
# 221 M-]
|
@@ -19,7 +19,7 @@ class Reline::KeyActor::ViInsert < Reline::KeyActor::Base
|
|
19
19
|
# 8 ^H
|
20
20
|
:vi_delete_prev_char,
|
21
21
|
# 9 ^I
|
22
|
-
:
|
22
|
+
:complete,
|
23
23
|
# 10 ^J
|
24
24
|
:ed_newline,
|
25
25
|
# 11 ^K
|
@@ -29,11 +29,11 @@ class Reline::KeyActor::ViInsert < Reline::KeyActor::Base
|
|
29
29
|
# 13 ^M
|
30
30
|
:ed_newline,
|
31
31
|
# 14 ^N
|
32
|
-
:
|
32
|
+
:menu_complete,
|
33
33
|
# 15 ^O
|
34
34
|
:ed_insert,
|
35
35
|
# 16 ^P
|
36
|
-
:
|
36
|
+
:menu_complete_backward,
|
37
37
|
# 17 ^Q
|
38
38
|
:ed_ignore,
|
39
39
|
# 18 ^R
|
@@ -41,7 +41,7 @@ class Reline::KeyActor::ViInsert < Reline::KeyActor::Base
|
|
41
41
|
# 19 ^S
|
42
42
|
:vi_search_next,
|
43
43
|
# 20 ^T
|
44
|
-
:
|
44
|
+
:ed_transpose_chars,
|
45
45
|
# 21 ^U
|
46
46
|
:vi_kill_line_prev,
|
47
47
|
# 22 ^V
|
@@ -51,7 +51,7 @@ class Reline::KeyActor::ViInsert < Reline::KeyActor::Base
|
|
51
51
|
# 24 ^X
|
52
52
|
:ed_insert,
|
53
53
|
# 25 ^Y
|
54
|
-
:
|
54
|
+
:em_yank,
|
55
55
|
# 26 ^Z
|
56
56
|
:ed_insert,
|
57
57
|
# 27 ^[
|
data/lib/reline/kill_ring.rb
CHANGED
@@ -14,7 +14,7 @@ class Reline::KillRing
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def ==(other)
|
17
|
-
|
17
|
+
equal?(other)
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
@@ -68,7 +68,7 @@ class Reline::KillRing
|
|
68
68
|
def append(string, before_p = false)
|
69
69
|
case @state
|
70
70
|
when State::FRESH, State::YANK
|
71
|
-
@ring << RingPoint.new(string)
|
71
|
+
@ring << RingPoint.new(+string)
|
72
72
|
@state = State::CONTINUED
|
73
73
|
when State::CONTINUED, State::PROCESSED
|
74
74
|
if before_p
|