diff options
author | aycabta <aycabta@gmail.com> | 2021-08-31 15:11:30 +0900 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2021-08-31 15:19:44 +0900 |
commit | 7afb5b8b95c7eadb5e776590566d0430d62e62f9 (patch) | |
tree | 8faf1e610a2e1558ffe68c043708ab14b7a0d5e3 | |
parent | 4f5166e790d1154447deaaf42ed1cdd647dd6bcf (diff) |
[ruby/reline] Use Reline::Unicode.take_range to devide exactly by width
https://github.com/ruby/reline/commit/de1ad93f44
-rw-r--r-- | lib/reline/line_editor.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb index b42b382e7d..382f638d25 100644 --- a/lib/reline/line_editor.rb +++ b/lib/reline/line_editor.rb @@ -652,7 +652,7 @@ class Reline::LineEditor bg_color = '46' end end - @output.write "\e[#{bg_color}m%-#{dialog.width}s\e[49m" % item.slice(0, dialog.width) + @output.write "\e[#{bg_color}m%-#{dialog.width}s\e[49m" % Reline::Unicode.take_range(item, 0, dialog.width) Reline::IOGate.move_cursor_column(dialog.column) move_cursor_down(1) if i < (dialog.contents.size - 1) end |