From 6a971f1060364d8b31a65b0de78aaef0c0ad385f Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Sat, 19 May 2012 23:49:30 -0700 Subject: [PATCH] Close tempfiles before editing [Fixes #575] --- lib/pry/default_commands/editing.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/pry/default_commands/editing.rb b/lib/pry/default_commands/editing.rb index e78129c1..54758f07 100644 --- a/lib/pry/default_commands/editing.rb +++ b/lib/pry/default_commands/editing.rb @@ -89,6 +89,7 @@ class Pry f.puts(content) f.flush reload = !opts.present?(:'no-reload') && !Pry.config.disable_auto_reload + f.close(false) invoke_editor(f.path, line, reload) if reload silence_warnings do @@ -209,6 +210,7 @@ class Pry temp_file do |f| f.puts lines.join f.flush + f.close(false) invoke_editor(f.path, 0, true) if @method.alias?