1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/reline] Workaround for padding width with Aracritty on macOS

https://github.com/ruby/reline/commit/fb4136c8a7
This commit is contained in:
Hiroshi SHIBATA 2022-09-02 14:26:17 +09:00 committed by git
parent 7ff50ee35c
commit 0d2422cf63

View file

@ -655,7 +655,10 @@ class Reline::LineEditor
end
private def padding_space_with_escape_sequences(str, width)
str + (' ' * (width - calculate_width(str, true)))
padding_width = width - calculate_width(str, true)
# padding_width should be only positive value. But macOS and Aracritty returns negative value.
padding_width = 0 if padding_width < 0
str + (' ' * padding_width)
end
private def render_each_dialog(dialog, cursor_column)