yap-rawline 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rawline/editor.rb +14 -13
- data/lib/rawline/renderer.rb +4 -1
- data/lib/rawline/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 21c58de0866271a9994af05648f35a469fa12fc8
|
4
|
+
data.tar.gz: fb7199d0dd979db6e7ca55a7999fe74a5c98fbb9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c0680fb3b2323de92e914f7cf798e46f6e11c68ddcec6e04dd505d14fcb75eddbe71120e34483c6c2486933689ff3e8fa4524b84b488a2db5324ee9074df295
|
7
|
+
data.tar.gz: 00e4152cd8285b61aa5ec59fe9556179e14f9b7f9b2fd98b4ab3a6ce396c5f0a1cff1489b51ba8d55d7c1a24657c05cf473444d7b0ee1d664708f83877392742
|
data/lib/rawline/editor.rb
CHANGED
@@ -252,7 +252,6 @@ module RawLine
|
|
252
252
|
|
253
253
|
def read_bytes(bytes)
|
254
254
|
return unless bytes.any?
|
255
|
-
@renderer.pause
|
256
255
|
|
257
256
|
Treefell['editor'].puts "read_bytes #{bytes.inspect}"
|
258
257
|
old_position = @line.position
|
@@ -260,20 +259,22 @@ module RawLine
|
|
260
259
|
key_code_sequences = parse_key_code_sequences(bytes)
|
261
260
|
|
262
261
|
Treefell['editor'].puts "key code sequences: #{key_code_sequences.inspect}"
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
262
|
+
begin
|
263
|
+
key_code_sequences.each do |sequence|
|
264
|
+
@char = sequence
|
265
|
+
if @char == @terminal.keys[:enter] || !@char
|
266
|
+
Treefell['editor'].puts "processing line: #{@line.text.inspect}"
|
267
|
+
|
268
|
+
@renderer.pause
|
269
|
+
process_line
|
270
|
+
else
|
271
|
+
process_character
|
272
|
+
new_position = @line.position
|
273
|
+
end
|
273
274
|
end
|
275
|
+
ensure
|
276
|
+
@renderer.unpause
|
274
277
|
end
|
275
|
-
ensure
|
276
|
-
@renderer.unpause
|
277
278
|
end
|
278
279
|
|
279
280
|
def process_line
|
data/lib/rawline/renderer.rb
CHANGED
@@ -25,9 +25,12 @@ module RawLine
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def render(reset: false)
|
28
|
-
Treefell['editor'].puts
|
28
|
+
Treefell['editor'].puts %|#{self.class}##{__callee__} reset=#{reset}}|
|
29
29
|
if @paused
|
30
30
|
Treefell['editor'].puts " paused"
|
31
|
+
if @render_on_unpause_kwargs && @render_on_unpause_kwargs[:reset]
|
32
|
+
reset = true
|
33
|
+
end
|
31
34
|
@render_on_unpause_kwargs = {reset: reset}
|
32
35
|
else
|
33
36
|
Treefell['editor'].puts " unpaused"
|
data/lib/rawline/version.rb
CHANGED