summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)