From a38cb7299078dd076bb70a220da8cb0f23bbe7ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mon=20ou=C3=AFe?= Date: Sun, 15 May 2011 12:08:59 +0200 Subject: [PATCH] Changed the place where input_array was modified --- lib/pry/pry_instance.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/pry/pry_instance.rb b/lib/pry/pry_instance.rb index e246ceaf..c655580a 100644 --- a/lib/pry/pry_instance.rb +++ b/lib/pry/pry_instance.rb @@ -169,7 +169,11 @@ class Pry # Do not want __FILE__, __LINE__ here because we need to distinguish # (eval) methods for show-method and friends. # This also sets the `_` local for the session. - set_last_result(target.eval(r(target)), target) + code = r(target) + res = set_last_result(target.eval(code), target) + + @input_array << code + res rescue SystemExit => e exit rescue Exception => e @@ -199,7 +203,6 @@ class Pry @suppress_output = true if eval_string =~ /;\Z/ || null_input?(val) - @input_array << eval_string eval_string end