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.
@@ -1,3 +1,3 @@
1
1
  module Reline
2
- VERSION = '0.2.8.pre.6'
2
+ VERSION = '0.2.8.pre.7'
3
3
  end
@@ -226,6 +226,8 @@ class Reline::Windows
226
226
  # no char, only control keys
227
227
  return if key.char_code == 0 and key.control_keys.any?
228
228
 
229
+ @@output_buf.push("\e".ord) if key.control_keys.include?(:ALT)
230
+
229
231
  @@output_buf.concat(key.char.bytes)
230
232
  end
231
233
 
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?# or target.size <= 3
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.6
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-02 00:00:00.000000000 Z
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