diff options
author | Nick Carboni <ncarboni@redhat.com> | 2015-10-08 15:32:43 -0400 |
---|---|---|
committer | Nick Carboni <ncarboni@redhat.com> | 2015-10-08 15:32:43 -0400 |
commit | 2342cc2e8bebcdb60924e827cef16f08600a1fb4 (patch) | |
tree | 77edd75437607720296c81a8ff839fe03d2a0b9d | |
parent | 215c646a75f4e5cb3b390e85c7a7efab53a40609 (diff) | |
download | highline-2342cc2e8bebcdb60924e827cef16f08600a1fb4.tar.gz |
Fixed issue where Array#split will return nil with only one element
Fixes #168
-rwxr-xr-x | lib/highline.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/highline.rb b/lib/highline.rb index 3d76c8f..561d2b5 100755 --- a/lib/highline.rb +++ b/lib/highline.rb @@ -994,7 +994,7 @@ class HighLine @output.puts lines.slice!(0...@page_at).join @output.puts # Return last line if user wants to abort paging - return (["...\n"] + lines.slice(-2,1)).join unless continue_paging? + return (["...\n"] + [lines.last]).join unless continue_paging? end return lines.join end |