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

[ruby/reline] Correct misalignment of scrollbar

https://github.com/ruby/reline/commit/7924b4cfc6
This commit is contained in:
aycabta 2021-09-04 07:46:41 +09:00
parent ec36ceb072
commit 03e9887d2e

View file

@ -680,11 +680,11 @@ class Reline::LineEditor
end end
str = padding_space_with_escape_sequences(Reline::Unicode.take_range(item, 0, dialog.width), dialog.width) str = padding_space_with_escape_sequences(Reline::Unicode.take_range(item, 0, dialog.width), dialog.width)
if dialog_render_info.scrollbar and dialog_render_info.contents.size > height if dialog_render_info.scrollbar and dialog_render_info.contents.size > height
if position <= (i * 2) and (i * 2) <= (position + bar_height) if position <= (i * 2) and (i * 2 + 1) < (position + bar_height)
str += '█' str += '█'
elsif position <= (i * 2) and (i * 2 - 1) <= (position + bar_height) elsif position <= (i * 2) and (i * 2) < (position + bar_height)
str += '▀' str += '▀'
elsif position <= (i * 2 + 1) and (i * 2) <= (position + bar_height) elsif position <= (i * 2 + 1) and (i * 2) < (position + bar_height)
str += '▄' str += '▄'
else else
str += ' ' str += ' '