diff options
author | aycabta <[email protected]> | 2021-10-09 22:19:05 +0900 |
---|---|---|
committer | git <[email protected]> | 2021-10-09 23:22:57 +0900 |
commit | e6ba2953e98f7feff90d767106b0a35560582ca0 (patch) | |
tree | e4712a7fda0b5ce976063536d0fc7601c7b2aaff /lib/reline/line_editor.rb | |
parent | c423cc932ee16f64a845e710d92baf79729eae63 (diff) |
[ruby/reline] Fix calculating dialog width with full-width scrollbar
https://github.com/ruby/reline/commit/93bc9b5277
Diffstat (limited to 'lib/reline/line_editor.rb')
-rw-r--r-- | lib/reline/line_editor.rb | 4 |
1 files changed, 2 insertions, 2 deletions
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 |