From 8a6fdfe7281ef975749450d65ac0efe0038354e5 Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Mon, 4 Mar 2013 23:11:19 -0800 Subject: [PATCH] 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. --- lib/pry/indent.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pry/indent.rb b/lib/pry/indent.rb index fc9c7add..e760655c 100644 --- a/lib/pry/indent.rb +++ b/lib/pry/indent.rb @@ -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"