yap-rawline 0.3.3 → 0.3.4

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
  SHA1:
3
- metadata.gz: ce2b5e0011a3641eea68691491f1e0b5e81344ea
4
- data.tar.gz: aba178fb5a2528664eb9447e3138b51b85fa392c
3
+ metadata.gz: fc11681274f5b951af403e11a4af120550c7751a
4
+ data.tar.gz: a47390374ffbacf2881d6f93d2ea624767ba0f2b
5
5
  SHA512:
6
- metadata.gz: c323b27b18f30f62f19124d58a8b9005f003c70c732298d5bdafb999e7ce1ec24954a077e0205b48f0eda181d40f0ff74cbc24eb03d14ee9a22c7816d783e38b
7
- data.tar.gz: ee29e835913c429fcf8399fd00fae9d65cc566df6b6d5805e782db0cc271875d7e051cbc76bde2914b7b6d0bc7191e3baf68335f9124cff16c29527fb51a2822
6
+ metadata.gz: ee26993157c86d07722228de7bb1e170c76cefbff92d631b1838fc9d12d16cb76f15485eb65e45495f5591baa70071048f0b20d004b4c7013ea275ecfa80c386
7
+ data.tar.gz: 9c717d3e9bd914f6bbe0c3df537e2e3dd6e2b453948f42706294f19371a562a4b9f0479d555468b18d98f30efafa706c11eeabf0adee8696fe2b7138bb57cabb
@@ -87,11 +87,11 @@ module RawLine
87
87
  Treefell['editor'].puts "completer, more than one possible completion"
88
88
 
89
89
  # Get first match
90
- @completion_matches.back
90
+ @completion_matches.forward
91
91
  match = @completion_matches.get
92
92
 
93
- Treefell['editor'].puts "completer: first completion: #{match} possible: #{possible_completions.inspect}"
94
- @completion_found_proc.call(completion: match, possible_completions: possible_completions)
93
+ Treefell['editor'].puts "completer: first completion: #{match} possible: #{@completion_matches.inspect}"
94
+ @completion_found_proc.call(completion: match, possible_completions: @completion_matches)
95
95
  end
96
96
 
97
97
  def handle_no_completions
@@ -102,12 +102,6 @@ module RawLine
102
102
  @done_proc.call
103
103
  end
104
104
 
105
- def possible_completions
106
- # completion matches is a history implementation and its in reverse order from what
107
- # a user would expect
108
- @completion_matches.reverse
109
- end
110
-
111
105
  def resize(matches)
112
106
  if matches.any?
113
107
  @completion_matches.resize(matches.length)
@@ -116,19 +110,19 @@ module RawLine
116
110
  end
117
111
 
118
112
  def select_next
119
- @completion_matches.back
113
+ @completion_matches.forward
120
114
  match = @completion_matches.get
121
115
 
122
- Treefell['editor'].puts "completer, selecting next match=#{match.inspect} possible_completions=#{possible_completions.inspect}"
123
- @completion_found_proc.call(completion: match, possible_completions: possible_completions)
116
+ Treefell['editor'].puts "completer, selecting next match=#{match.inspect} possible_completions=#{@completion_matches.inspect}"
117
+ @completion_found_proc.call(completion: match, possible_completions: @completion_matches)
124
118
  end
125
119
 
126
120
  def select_previous
127
- @completion_matches.forward
121
+ @completion_matches.back
128
122
  match = @completion_matches.get
129
123
 
130
- Treefell['editor'].puts "completer, selecting previous match=#{match.inspect} possible_completions=#{possible_completions.inspect}"
131
- @completion_found_proc.call(completion: match, possible_completions: possible_completions)
124
+ Treefell['editor'].puts "completer, selecting previous match=#{match.inspect} possible_completions=#{@completion_matches.inspect}"
125
+ @completion_found_proc.call(completion: match, possible_completions: @completion_matches)
132
126
  end
133
127
  end
134
128
  end
@@ -136,7 +136,7 @@ module RawLine
136
136
 
137
137
  case @position
138
138
  when nil then
139
- nil
139
+ @position = 0
140
140
  when length-1 then
141
141
  @position = 0 if @cycle
142
142
  else
@@ -1,3 +1,3 @@
1
1
  module RawLine
2
- VERSION = "0.3.3"
2
+ VERSION = "0.3.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yap-rawline
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fabio Cevasco