Skip to content

Commit

Permalink
[ruby/reline] The @block_elem_width shouldn't be used for height calc…
Browse files Browse the repository at this point in the history
  • Loading branch information
aycabta authored and matzbot committed Oct 3, 2021
1 parent 7c6ef27 commit 1d2edda
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/reline/line_editor.rb
Expand Up @@ -711,12 +711,12 @@ def add_dialog_proc(name, p, context = nil)
@output.write "\e[#{bg_color}m#{str}"
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)
if dialog.scrollbar_pos <= (i * 2) and (i * 2) < (dialog.scrollbar_pos + bar_height)
@output.write '█'
elsif dialog.scrollbar_pos <= (i * 2) and (i * 2) < (dialog.scrollbar_pos + bar_height)
@output.write '▀'
str += ''
elsif dialog.scrollbar_pos <= (i * 2 + @block_elem_width) and (i * 2) < (dialog.scrollbar_pos + bar_height)
elsif dialog.scrollbar_pos <= (i * 2) and (i * 2) < (dialog.scrollbar_pos + bar_height)
@output.write '▄'
else
@output.write ' ' * @block_elem_width
Expand Down

0 comments on commit 1d2edda

Please sign in to comment.