From 44aae5fee666e6767415c214e25e90f6ad565550 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sat, 6 Jul 2019 12:11:12 +0900 Subject: Simplified --- lib/reline/line_editor.rb | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'lib/reline/line_editor.rb') 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) -- cgit v1.2.3