Question

In my gitbash shell on windows I can run the following with no problem:

sublime_text encryptor.rb:13

Using the instructions here, I set my editor of choice in pry like this:

Pry.config.editor = proc { |file, line| "sublime_text '#{file}':#{line}" } "sublime_text '#{file}':#{line}" }

However when sublime opens, it does so with 2 blank files named "encryptor.rb" and "'c".

For giggles I tried:

Pry.config.editor = "sublime_text"

This caused the same blank "encyptor.rb" to open and another file named "Google" which was blank to open.

The path to the file is c:\Users\admin\Google Drive\projects\encryptor.rb

I bet the space in the path is causing havoc...

My question is how can I use sublime as my default editor in pry on a windows box? I tried setting up emacs as well and had the same issue. Though I'm open to suggestions, at this point I'm more concerned with setting it up with sublime.

Thanks for you help!

Versions: Sublime 3, Pry version 0.9.12.2 on Ruby 1.9.3, windows 7

Was it helpful?

Solution

Use " instead of ':

Pry.config.editor = proc { |file, line| %("sublime_text.exe" "#{file}":#{line}) }
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top