tty2-reader 0.9.0.2 → 0.9.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 602c87e30c4416077e84bc08207d5138250c63207da0e70a6da55320b1800f31
4
- data.tar.gz: 30d5e3a3ea92318c774d6983b645c85d43f54ec53b5ac43e8df18d7ce0d651b8
3
+ metadata.gz: e1eb337d88aa2e8c6b6c53fcd9010b7017f9ffc877bc749d8064767c920d5016
4
+ data.tar.gz: cafbcdbbe33f63a3a14d2e9f4e27e78ad58cb620493fb50d12e8e6f2b7454770
5
5
  SHA512:
6
- metadata.gz: ca7eb534f55eb6dba4507bca95829fc185e5b080a528eecb9da3d4d124877c63cefe57d62ff15276799e36c6b53748743fff0d6eb73130715f3d741273fb17ab
7
- data.tar.gz: 7f1e1d9955be5880b55a46fabe62286778acbac5484384a450652c1a319aad3b31cfa4cc01b5c7c5dae5b11371b556dd852b27652d9bc4640971a17a7a5499b0
6
+ metadata.gz: cc5afc35da75d801c8964fda008edc28da2c2726a2c3a69831c2f0ec1b88b1d51640c6504007b466f49cb847b7e3f44a46553e4585e377c96e559706c7e159a8
7
+ data.tar.gz: ef37e02ca29266e97fddf207503274398649dd3414212ef29000f12aad5a363cd51d4f69206b4f5680c67b4bf4ee2b00460f67672d1eeec06d2b93b228174e27
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Change log
2
2
 
3
+ ## [v0.9.0.3] - 2022-02-07
4
+
5
+ ### Added
6
+ * Added support for consecutive initial completions
7
+
8
+
3
9
  ## [v0.9.0.2] - 2022-02-02
4
10
 
5
11
  ### Fix
@@ -18,5 +24,6 @@
18
24
  ### Fix
19
25
 
20
26
 
27
+ [v0.9.0.3]: https://github.com/zzyzwicz/tty2-reader/compare/v0.9.0.3
21
28
  [v0.9.0.2]: https://github.com/zzyzwicz/tty2-reader/compare/v0.9.0.2
22
29
  [v0.9.0.1]: https://github.com/zzyzwicz/tty2-reader/compare/v0.9.0.1
@@ -33,6 +33,7 @@ module TTY2
33
33
  @completions = Completions.new
34
34
  @show_initial = false
35
35
  @word = ""
36
+ @completed = false
36
37
  end
37
38
 
38
39
  # Find a suggestion to complete a word
@@ -49,7 +50,7 @@ module TTY2
49
50
  #
50
51
  # @api public
51
52
  def complete(line, direction: :next, initial: false)
52
- if initial
53
+ if initial || @completed
53
54
  complete_initial(line, direction: direction)
54
55
  elsif @cycling
55
56
  complete_next(line, direction: direction)
@@ -68,6 +69,7 @@ module TTY2
68
69
  #
69
70
  # @api public
70
71
  def complete_initial(line, direction: :next)
72
+ @completed = false
71
73
  completed_word = complete_word(line)
72
74
  return if @completions.empty?
73
75
  if @cycling && completions.size > 1
@@ -165,6 +167,7 @@ module TTY2
165
167
  elsif completions.size == 1
166
168
  completed_word = completions.first
167
169
  line.insert(completions.first[position..-1] + suffix)
170
+ @completed = true
168
171
  end
169
172
 
170
173
  completed_word
@@ -2,6 +2,6 @@
2
2
 
3
3
  module TTY2
4
4
  class Reader
5
- VERSION = "0.9.0.2"
5
+ VERSION = "0.9.0.3"
6
6
  end # Reader
7
7
  end # TTY2
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tty2-reader
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0.2
4
+ version: 0.9.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - zzyzwicz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-02 00:00:00.000000000 Z
11
+ date: 2022-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tty-screen