diff options
author | Abinoam Praxedes Marques Jr <abinoam@gmail.com> | 2015-10-09 13:44:38 -0300 |
---|---|---|
committer | Abinoam Praxedes Marques Jr <abinoam@gmail.com> | 2015-10-09 15:05:19 -0300 |
commit | e8309e69d6fb292d291b4ce325b8783eabe3e9fe (patch) | |
tree | fd0036adffa2b71adfd09bcbdbb70ab86522341a | |
parent | 94adabbb5dd27bdccd6e3afdbf0d703965cf8113 (diff) | |
download | highline-e8309e69d6fb292d291b4ce325b8783eabe3e9fe.tar.gz |
Fix for erroneous pagination when same line count of HighLine#page_at
Basically using scan to split the statement in lines was lefting an adicional last element that was an empty string.
Using String#lines is the current way to do it properly.
-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 561d2b5..19fe032 100755 --- a/lib/highline.rb +++ b/lib/highline.rb @@ -989,7 +989,7 @@ class HighLine # instead. This is to support any special handling for the final sequence. # def page_print( output ) - lines = output.scan(/[^\n]*\n?/) + lines = output.lines while lines.size > @page_at @output.puts lines.slice!(0...@page_at).join @output.puts |