Skip to content

Commit 590efd0

Browse files
committed
Fix DialogProcScope width hight calculation
1 parent 5282482 commit 590efd0

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
@@ -572,15 +572,16 @@ def just_cursor_moving
572572
end
573573

574574
def screen_width
575-
@line_editor.instance_variable_get(:@screen_size).last
575+
@line_editor.screen_width
576576
end
577577

578578
def screen_height
579-
@line_editor.instance_variable_get(:@screen_size).first
579+
@line_editor.screen_height
580580
end
581581

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

586587
def completion_journey_data

0 commit comments

Comments
 (0)