reline 0.2.8.pre.6 → 0.2.8.pre.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/reline/line_editor.rb +30 -6
- data/lib/reline/line_editor.rb.orig +3156 -0
- data/lib/reline/version.rb +1 -1
- data/lib/reline/windows.rb +2 -0
- data/lib/reline.rb +9 -3
- metadata +3 -2
data/lib/reline/version.rb
CHANGED
data/lib/reline/windows.rb
CHANGED
data/lib/reline.rb
CHANGED
@@ -16,7 +16,13 @@ module Reline
|
|
16
16
|
|
17
17
|
class ConfigEncodingConversionError < StandardError; end
|
18
18
|
|
19
|
-
Key = Struct.new('Key', :char, :combined_char, :with_meta)
|
19
|
+
Key = Struct.new('Key', :char, :combined_char, :with_meta) do
|
20
|
+
def match?(key)
|
21
|
+
(key.char.nil? or char.nil? or char == key.char) and
|
22
|
+
(key.combined_char.nil? or combined_char.nil? or combined_char == key.combined_char) and
|
23
|
+
(key.with_meta.nil? or with_meta.nil? or with_meta == key.with_meta)
|
24
|
+
end
|
25
|
+
end
|
20
26
|
CursorPos = Struct.new(:x, :y)
|
21
27
|
DialogRenderInfo = Struct.new(:pos, :contents, :pointer, :bg_color, :width, :height, keyword_init: true)
|
22
28
|
|
@@ -195,7 +201,7 @@ module Reline
|
|
195
201
|
return nil
|
196
202
|
end
|
197
203
|
pre, target, post = retrieve_completion_block(true)
|
198
|
-
if target.nil? or target.empty
|
204
|
+
if target.nil? or target.empty? or target.size <= 3
|
199
205
|
return nil
|
200
206
|
end
|
201
207
|
if completion_journey_data and completion_journey_data.list
|
@@ -206,7 +212,7 @@ module Reline
|
|
206
212
|
result = call_completion_proc_with_checking_args(pre, target, post)
|
207
213
|
pointer = nil
|
208
214
|
end
|
209
|
-
if result and result.size == 1 and result[0] == target
|
215
|
+
if result and result.size == 1 and result[0] == target and pointer != 0
|
210
216
|
result = nil
|
211
217
|
end
|
212
218
|
target_width = Reline::Unicode.calculate_width(target)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: reline
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.8.pre.
|
4
|
+
version: 0.2.8.pre.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- aycabta
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-09-
|
11
|
+
date: 2021-09-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: io-console
|
@@ -47,6 +47,7 @@ files:
|
|
47
47
|
- lib/reline/key_stroke.rb
|
48
48
|
- lib/reline/kill_ring.rb
|
49
49
|
- lib/reline/line_editor.rb
|
50
|
+
- lib/reline/line_editor.rb.orig
|
50
51
|
- lib/reline/sibori.rb
|
51
52
|
- lib/reline/terminfo.rb
|
52
53
|
- lib/reline/unicode.rb
|