Skip to content

Commit fb4136c

Browse files
committed
Workaround for padding width with Aracritty on macOS
1 parent f5fa30d commit fb4136c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/reline/line_editor.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,10 @@ def add_dialog_proc(name, p, context = nil)
655655
end
656656

657657
private def padding_space_with_escape_sequences(str, width)
658-
str + (' ' * (width - calculate_width(str, true)))
658+
padding_width = width - calculate_width(str, true)
659+
# padding_width should be only positive value. But macOS and Aracritty returns negative value.
660+
padding_width = 0 if padding_width < 0
661+
str + (' ' * padding_width)
659662
end
660663

661664
private def render_each_dialog(dialog, cursor_column)

0 commit comments

Comments
 (0)