reline 0.3.4 → 0.3.5
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 +11 -1
- data/lib/reline/terminfo.rb +1 -15
- data/lib/reline/version.rb +1 -1
- data/lib/reline.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3654e31f9c5d1aa879ae40dfb28b8de68f2e443fac87856f2387a22d61a5b4e7
|
4
|
+
data.tar.gz: 0fdccab5b7cfd91274e3e4544dcca69a442176cc85e1eba382da3ffd02f9ac30
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9277033707e4a1531e8590ae6a76019c21c60da22f69ea333dcc5c3d3610499303ed7892308b6ae3b495237738344baac7a21c547a19ff77f53fecae29be9a14
|
7
|
+
data.tar.gz: 5f3f225d7b1ee1f0ab067d8a897366a3d3b922dcedb74ae3ec980e387ad3b520d8ab808f70d89e109d06f7e5017ab6406d30e25ed2b6678b3fc8d6c4d5cf6930
|
data/lib/reline/line_editor.rb
CHANGED
@@ -562,6 +562,16 @@ class Reline::LineEditor
|
|
562
562
|
@line_editor.instance_variable_get(:@screen_size).last
|
563
563
|
end
|
564
564
|
|
565
|
+
def screen_height
|
566
|
+
@line_editor.instance_variable_get(:@screen_size).first
|
567
|
+
end
|
568
|
+
|
569
|
+
def preferred_dialog_height
|
570
|
+
rest_height = @line_editor.instance_variable_get(:@rest_height)
|
571
|
+
scroll_partial_screen = @line_editor.instance_variable_get(:@scroll_partial_screen) || 0
|
572
|
+
[cursor_pos.y - scroll_partial_screen, rest_height, (screen_height + 6) / 5].max
|
573
|
+
end
|
574
|
+
|
565
575
|
def completion_journey_data
|
566
576
|
@line_editor.instance_variable_get(:@completion_journey_data)
|
567
577
|
end
|
@@ -714,7 +724,7 @@ class Reline::LineEditor
|
|
714
724
|
ymax = ymax.clamp(screen_y_range.begin, screen_y_range.end)
|
715
725
|
dialog_y = @first_line_started_from + @started_from
|
716
726
|
cursor_y = dialog_y
|
717
|
-
if @highest_in_all
|
727
|
+
if @highest_in_all <= ymax
|
718
728
|
scroll_down(ymax - cursor_y)
|
719
729
|
move_cursor_up(ymax - cursor_y)
|
720
730
|
end
|
data/lib/reline/terminfo.rb
CHANGED
@@ -31,21 +31,7 @@ module Reline::Terminfo
|
|
31
31
|
@curses_dl = false
|
32
32
|
def self.curses_dl
|
33
33
|
return @curses_dl unless @curses_dl == false
|
34
|
-
if
|
35
|
-
# Gem module isn't defined in test-all of the Ruby repository, and
|
36
|
-
# Fiddle in Ruby 3.0.0 or later supports Fiddle::TYPE_VARIADIC.
|
37
|
-
fiddle_supports_variadic = true
|
38
|
-
elsif Fiddle.const_defined?(:VERSION,false) and Gem::Version.create(Fiddle::VERSION) >= Gem::Version.create('1.0.1')
|
39
|
-
# Fiddle::TYPE_VARIADIC is supported from Fiddle 1.0.1.
|
40
|
-
fiddle_supports_variadic = true
|
41
|
-
else
|
42
|
-
fiddle_supports_variadic = false
|
43
|
-
end
|
44
|
-
if fiddle_supports_variadic and not Fiddle.const_defined?(:TYPE_VARIADIC)
|
45
|
-
# If the libffi version is not 3.0.5 or higher, there isn't TYPE_VARIADIC.
|
46
|
-
fiddle_supports_variadic = false
|
47
|
-
end
|
48
|
-
if fiddle_supports_variadic
|
34
|
+
if Fiddle.const_defined?(:TYPE_VARIADIC)
|
49
35
|
curses_dl_files.each do |curses_name|
|
50
36
|
result = Fiddle::Handle.new(curses_name)
|
51
37
|
rescue Fiddle::DLError
|
data/lib/reline/version.rb
CHANGED
data/lib/reline.rb
CHANGED
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.3.
|
4
|
+
version: 0.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- aycabta
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-06-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: io-console
|