From 03e9887d2e4c637a70791c65be6e496dbe190ed1 Mon Sep 17 00:00:00 2001 From: aycabta Date: Sat, 4 Sep 2021 07:46:41 +0900 Subject: [PATCH] [ruby/reline] Correct misalignment of scrollbar https://github.com/ruby/reline/commit/7924b4cfc6 --- lib/reline/line_editor.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb index e52c4e5fd3..21db97fce6 100644 --- a/lib/reline/line_editor.rb +++ b/lib/reline/line_editor.rb @@ -680,11 +680,11 @@ class Reline::LineEditor 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 += ' '