From e6ba2953e98f7feff90d767106b0a35560582ca0 Mon Sep 17 00:00:00 2001 From: aycabta Date: Sat, 9 Oct 2021 22:19:05 +0900 Subject: [ruby/reline] Fix calculating dialog width with full-width scrollbar https://github.com/ruby/reline/commit/93bc9b5277 --- lib/reline/line_editor.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/reline') diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb index 7c68037878..a71bb65259 100644 --- a/lib/reline/line_editor.rb +++ b/lib/reline/line_editor.rb @@ -703,7 +703,8 @@ class Reline::LineEditor 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 @@ -719,7 +720,6 @@ class Reline::LineEditor 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 -- cgit v1.2.3