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