summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2021-09-04 07:46:41 +0900
committeraycabta <aycabta@gmail.com>2021-09-04 21:40:17 +0900
commit03e9887d2e4c637a70791c65be6e496dbe190ed1 (patch)
tree116cf08ac8de08e211ba345764e11d2089f17888 /lib
parentec36ceb072be5b08dbdd747443192901a1c771e9 (diff)
[ruby/reline] Correct misalignment of scrollbar
https://github.com/ruby/reline/commit/7924b4cfc6
Diffstat (limited to 'lib')
-rw-r--r--lib/reline/line_editor.rb6
1 files 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 += ' '