diff options
author | aycabta <aycabta@gmail.com> | 2021-09-04 07:46:41 +0900 |
---|---|---|
committer | aycabta <aycabta@gmail.com> | 2021-09-04 21:40:17 +0900 |
commit | 03e9887d2e4c637a70791c65be6e496dbe190ed1 (patch) | |
tree | 116cf08ac8de08e211ba345764e11d2089f17888 | |
parent | ec36ceb072be5b08dbdd747443192901a1c771e9 (diff) | |
download | ruby-03e9887d2e4c637a70791c65be6e496dbe190ed1.tar.gz |
[ruby/reline] Correct misalignment of scrollbar
https://github.com/ruby/reline/commit/7924b4cfc6
-rw-r--r-- | lib/reline/line_editor.rb | 6 |
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 += ' ' |