1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/reline] Render scrollbar when the column of the dialog is moved

https://github.com/ruby/reline/commit/5cea268e56
This commit is contained in:
aycabta 2021-09-08 03:27:39 +09:00 committed by git
parent 8b6d757ba0
commit e4eb085329

View file

@ -709,7 +709,7 @@ class Reline::LineEditor
str_width = dialog.width - (dialog.scrollbar_pos.nil? ? 0 : @block_elem_width)
str = padding_space_with_escape_sequences(Reline::Unicode.take_range(item, 0, str_width), str_width)
@output.write "\e[#{bg_color}m#{str}"
if dialog.scrollbar_pos and dialog.scrollbar_pos != old_dialog.scrollbar_pos
if dialog.scrollbar_pos and (dialog.scrollbar_pos != old_dialog.scrollbar_pos or dialog.column != old_dialog.column)
@output.write "\e[37m"
if dialog.scrollbar_pos <= (i * 2) and (i * 2 + @block_elem_width) < (dialog.scrollbar_pos + bar_height)
@output.write '█'