From d67f16e424b407a656f09573ccac808db1976cbc Mon Sep 17 00:00:00 2001 From: John Mair Date: Mon, 19 Sep 2011 17:44:47 +1200 Subject: [PATCH] pushing current input obj onto input_stack before redirecting input --- lib/pry/default_commands/input.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/pry/default_commands/input.rb b/lib/pry/default_commands/input.rb index 6b2de6c3..33023769 100644 --- a/lib/pry/default_commands/input.rb +++ b/lib/pry/default_commands/input.rb @@ -88,7 +88,6 @@ class Pry range = (0..-2) if opts.o? eval_string << Array(code.each_line.to_a[range]).join - run "show-input" if opts.o? elsif opts.f? file_name = File.expand_path(opts[:f]) next output.puts "No such file: #{opts[:f]}" if !File.exists?(file_name) @@ -96,6 +95,7 @@ class Pry range = opts.l? ? one_index_range_or_number(opts[:l]) : (0..-1) range = (0..-2) if opts.o? + _pry_.input_stack << _pry_.input _pry_.input = StringIO.new(Array(text_array[range]).join) else next output.puts "Error: no input to play command" if !args.first @@ -223,6 +223,7 @@ class Pry if opts.replay? range = opts['replay'] actions = Array(history[range]).join("\n") + "\n" + _pry_.input_stack << _pry_.input _pry_.input = StringIO.new(actions) next end