Skip to content

Commit

Permalink
Use Reline::Unicode.take_range to devide exactly by width
Browse files Browse the repository at this point in the history
  • Loading branch information
aycabta committed Aug 31, 2021
1 parent e2b87fe commit de1ad93
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/reline/line_editor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ def add_dialog_proc(name, p, context = nil)
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
Expand Down

0 comments on commit de1ad93

Please sign in to comment.