diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-07-06 12:11:12 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-07-06 12:11:12 +0900 |
commit | 44aae5fee666e6767415c214e25e90f6ad565550 (patch) | |
tree | fd3ffc67dee2ed433b1cba068460ffd70c510287 | |
parent | 833cfeb2260c460d05c75cc6d16fa992d881ec54 (diff) | |
download | ruby-44aae5fee666e6767415c214e25e90f6ad565550.tar.gz |
Simplified
-rw-r--r-- | lib/reline/line_editor.rb | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb index 62965d0662..6bcfb4b5cc 100644 --- a/lib/reline/line_editor.rb +++ b/lib/reline/line_editor.rb @@ -136,14 +136,7 @@ class Reline::LineEditor end private def calculate_height_by_width(width) - return 1 if width.zero? - height = 1 - max_width = @screen_size.last - while width > max_width * height - height += 1 - end - height += 1 if (width % max_width).zero? - height + width.div(@screen_size.last) + 1 end private def split_by_width(prompt, str, max_width) |