Skip to content

Commit

Permalink
Merge pull request #627 from kyrylo/bugfix-623-edit-command-cannot-ha…
Browse files Browse the repository at this point in the history
…ndle-paths-with-spaces-in-the-name

Fix space handling for `edit` command
  • Loading branch information
banister committed Jul 1, 2012
2 parents 7001a35 + a58703b commit d4772d3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/pry/default_commands/editing.rb
@@ -1,4 +1,5 @@
require 'tempfile'
require 'shellwords'
require 'pry/default_commands/hist'

class Pry
Expand Down Expand Up @@ -141,8 +142,12 @@ def process_remote_edit
line = opts[:l].to_i if opts.present?(:line)

reload = opts.present?(:reload) || ((opts.present?(:ex) || file_name.end_with?(".rb")) && !opts.present?(:'no-reload')) && !Pry.config.disable_auto_reload
invoke_editor(file_name, line, reload)
set_file_and_dir_locals(file_name)

# Sanitize blanks.
sanitized_file_name = Shellwords.escape(file_name)

invoke_editor(sanitized_file_name, line, reload)
set_file_and_dir_locals(sanitized_file_name)

if reload
silence_warnings do
Expand Down

0 comments on commit d4772d3

Please sign in to comment.