summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-10-12 10:05:58 +0900
committergit <svn-admin@ruby-lang.org>2021-10-12 13:19:24 +0900
commit1009fd7ee3d04c5cc4ca4a8b523a6d4d56a0da88 (patch)
tree490bedd967c121004ed8120b183c73187a1a1646 /lib
parentec4d536d420d0071778d80f55695f285b5d92faf (diff)
[ruby/reline] Revert "Fix zero division when the screen width is not available"
This reverts commit 0dce9da083541f42c31822a91c72f339934c3986. https://github.com/ruby/reline/commit/f71471cdde
Diffstat (limited to 'lib')
-rw-r--r--lib/reline/line_editor.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb
index c1bb49033a..f6facc9da8 100644
--- a/lib/reline/line_editor.rb
+++ b/lib/reline/line_editor.rb
@@ -340,8 +340,7 @@ class Reline::LineEditor
end
private def calculate_height_by_width(width)
- max_width = @screen_size.last
- max_width > 0 ? (width.div(max_width) + 1) : 1
+ width.div(@screen_size.last) + 1
end
private def split_by_width(str, max_width)