зеркало из https://github.com/github/ruby.git
[ruby/reline] Fix zero division when the screen width is not available
https://github.com/ruby/reline/commit/0dce9da083
This commit is contained in:
Родитель
e212d051d0
Коммит
60689f0f20
|
@ -340,7 +340,8 @@ class Reline::LineEditor
|
|||
end
|
||||
|
||||
private def calculate_height_by_width(width)
|
||||
width.div(@screen_size.last) + 1
|
||||
max_width = @screen_size.last
|
||||
max_width > 0 ? (width.div(max_width) + 1) : 1
|
||||
end
|
||||
|
||||
private def split_by_width(str, max_width)
|
||||
|
|
Загрузка…
Ссылка в новой задаче