1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00

Ensure lines are integers before using them as strings [Fixes #872]

The problem was that they could be Rational's if the mathn library was
required.
This commit is contained in:
Conrad Irwin 2013-03-04 23:11:19 -08:00
parent d6ef67cfa7
commit 8a6fdfe728

View file

@ -390,7 +390,7 @@ class Pry
_, cols = Terminal.screen_size
cols = cols.to_i
lines = cols != 0 ? (line_to_measure.length / cols + 1) : 1
lines = (cols != 0 ? (line_to_measure.length / cols + 1) : 1).to_i
if Pry::Helpers::BaseHelpers.windows_ansi?
move_up = "\e[#{lines}F"