diff --git a/lib/pry/config.rb b/lib/pry/config.rb index 155184a5..f9b88fa2 100644 --- a/lib/pry/config.rb +++ b/lib/pry/config.rb @@ -75,6 +75,10 @@ class Pry # @return [Boolean] attr_accessor :should_load_requires + # Determines whether to disable edit-method's auto-reloading behavior. + # @return [Boolean] + attr_accessor :disable_auto_reload + # Config option for history. # sub-options include hist.file, hist.load, and hist.save # hist.file is the file to save/load history too, e.g diff --git a/lib/pry/default_commands/introspection.rb b/lib/pry/default_commands/introspection.rb index 1d4f3e3a..65c91332 100644 --- a/lib/pry/default_commands/introspection.rb +++ b/lib/pry/default_commands/introspection.rb @@ -147,7 +147,7 @@ class Pry opt.on :M, "instance-methods", "Operate on instance methods." opt.on :m, :methods, "Operate on methods." - opt.on :n, "no-reload", "Do not automatically reload the method's file after editting." + opt.on :n, "no-reload", "Do not automatically reload the method's file after editing." opt.on "no-jump", "Do not fast forward editor to first line of method." opt.on :c, :context, "Select object context to run under.", true do |context| target = Pry.binding_for(target.eval(context)) @@ -179,7 +179,7 @@ class Pry invoke_editor(file, opts["no-jump"] ? 0 : line) silence_warnings do - load file if !opts.n? + load file if !opts.n? && !Pry.config.disable_auto_reload end end end diff --git a/lib/pry/pry_class.rb b/lib/pry/pry_class.rb index 9c284be1..d3754dae 100644 --- a/lib/pry/pry_class.rb +++ b/lib/pry/pry_class.rb @@ -198,6 +198,7 @@ class Pry config.pager = true config.editor = default_editor_for_platform config.should_load_rc = true + config.disable_auto_reload = false config.plugins ||= OpenStruct.new config.plugins.enabled = true