Skip to content

Commit de1ad93

Browse files
committed
Use Reline::Unicode.take_range to devide exactly by width
1 parent e2b87fe commit de1ad93

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/reline/line_editor.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ def add_dialog_proc(name, p, context = nil)
652652
bg_color = '46'
653653
end
654654
end
655-
@output.write "\e[#{bg_color}m%-#{dialog.width}s\e[49m" % item.slice(0, dialog.width)
655+
@output.write "\e[#{bg_color}m%-#{dialog.width}s\e[49m" % Reline::Unicode.take_range(item, 0, dialog.width)
656656
Reline::IOGate.move_cursor_column(dialog.column)
657657
move_cursor_down(1) if i < (dialog.contents.size - 1)
658658
end

0 commit comments

Comments
 (0)