Skip to content

Commit e92440a

Browse files
committed
Fix DialogProcScope width hight calculation
1 parent f46f39e commit e92440a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/reline/line_editor.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -571,15 +571,16 @@ def just_cursor_moving
571571
end
572572

573573
def screen_width
574-
@line_editor.instance_variable_get(:@screen_size).last
574+
@line_editor.screen_width
575575
end
576576

577577
def screen_height
578-
@line_editor.instance_variable_get(:@screen_size).first
578+
@line_editor.screen_height
579579
end
580580

581581
def preferred_dialog_height
582-
[cursor_pos.y - @line_editor.screen_scroll_top, @line_editor.rest_height, (screen_height + 6) / 5].max
582+
_editor_cursor_x, editor_cursor_y = @line_editor.editor_cursor_position
583+
[editor_cursor_y - @line_editor.screen_scroll_top, @line_editor.rest_height, (screen_height + 6) / 5].max
583584
end
584585

585586
def completion_journey_data

0 commit comments

Comments
 (0)