Skip to content

Commit

Permalink
[ruby/reline] Correct misalignment of scrollbar
Browse files Browse the repository at this point in the history
  • Loading branch information
aycabta committed Sep 4, 2021
1 parent ec36ceb commit 03e9887
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/reline/line_editor.rb
Expand Up @@ -680,11 +680,11 @@ def add_dialog_proc(name, p, context = nil)
end
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 position <= (i * 2) and (i * 2) <= (position + bar_height)
if position <= (i * 2) and (i * 2 + 1) < (position + bar_height)
str += '█'
elsif position <= (i * 2) and (i * 2 - 1) <= (position + bar_height)
elsif position <= (i * 2) and (i * 2) < (position + bar_height)
str += '▀'
elsif position <= (i * 2 + 1) and (i * 2) <= (position + bar_height)
elsif position <= (i * 2 + 1) and (i * 2) < (position + bar_height)
str += '▄'
else
str += ' '
Expand Down

0 comments on commit 03e9887

Please sign in to comment.