Skip to content

Commit

Permalink
Fix calculating dialog width with full-width scrollbar
Browse files Browse the repository at this point in the history
  • Loading branch information
aycabta committed Oct 9, 2021
1 parent dd8f563 commit 93bc9b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/reline/line_editor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,8 @@ def add_dialog_proc(name, p, context = nil)
upper_space = @first_line_started_from - @started_from
lower_space = @highest_in_all - @first_line_started_from - @started_from - 1
dialog.column = dialog_render_info.pos.x
diff = (dialog.column + dialog.width) - (@screen_size.last - 1)
dialog.width += @block_elem_width if dialog.scrollbar_pos
diff = (dialog.column + dialog.width) - (@screen_size.last)
if diff > 0
dialog.column -= diff
end
Expand All @@ -719,7 +720,6 @@ def add_dialog_proc(name, p, context = nil)
dialog.vertical_offset = dialog_render_info.pos.y + 1
end
Reline::IOGate.hide_cursor
dialog.width += @block_elem_width if dialog.scrollbar_pos
if dialog.column < 0
dialog.column = 0
dialog.width = @screen_size.last
Expand Down

0 comments on commit 93bc9b5

Please sign in to comment.