Skip to content

Commit 93bc9b5

Browse files
committed
Fix calculating dialog width with full-width scrollbar
1 parent dd8f563 commit 93bc9b5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/reline/line_editor.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,8 @@ def add_dialog_proc(name, p, context = nil)
703703
upper_space = @first_line_started_from - @started_from
704704
lower_space = @highest_in_all - @first_line_started_from - @started_from - 1
705705
dialog.column = dialog_render_info.pos.x
706-
diff = (dialog.column + dialog.width) - (@screen_size.last - 1)
706+
dialog.width += @block_elem_width if dialog.scrollbar_pos
707+
diff = (dialog.column + dialog.width) - (@screen_size.last)
707708
if diff > 0
708709
dialog.column -= diff
709710
end
@@ -719,7 +720,6 @@ def add_dialog_proc(name, p, context = nil)
719720
dialog.vertical_offset = dialog_render_info.pos.y + 1
720721
end
721722
Reline::IOGate.hide_cursor
722-
dialog.width += @block_elem_width if dialog.scrollbar_pos
723723
if dialog.column < 0
724724
dialog.column = 0
725725
dialog.width = @screen_size.last

0 commit comments

Comments
 (0)