-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TextWrangler as Editor on mac #83
Comments
Do you have a reference to the docs for TextWrangler on how command line arguments are invoked for this application? |
So specifying |
reference to the docs is man edit, or I can attach a PDF made using pman [a useful bin script] |
this is expanding now... must have cocked it up last night def self.open_file(file, line = 0)
editor = self.application
arguments = self.arguments
arguments.gsub!('{FILE}', file)
arguments.gsub!('{LINE}', line)
if editor =~ /TextWrangler/
command = %[edit --separate-windows #{arguments}]
else
command = %["#{editor}" #{arguments}]
end
puts command
system(command)
end |
So if you hard coded |
(P.S. it's easier to read chunks of code if you mark them up as code blocks) |
why not just type in edit --separate-windows it returns "edit --separate-windows" which won't run due to the quotes... |
Ah, so maybe the quotes needs to be specified in the Preference dialog so there is enough flexibility. |
It less obscure to use the app name in Preferences and hardcode conditionals. A lot of people use TextWrangler, but never unix tools like 'edit' |
I have been thinking of a dropdown list of editor names where the command lines has been set up in advance. |
the default on the mac is really system(open "`#{file}") that will open the file depending on it's extension, in whichever app the user normally uses, if you prepend that with -a, it opens in a chosen App, so system(open -a "#{application}" "`#{file}") if you want to open at the line number then you need the 'command-line' versions depending on your choice of editor, which not everyone will have... what about an advanced tab, in preferences, that allows you to enter your own command? |
Ruby files are often associated with the Ruby interpreter - we don't want to execute the RB script. I was thinking of simply having a drop down list with per defined editors above the Editor and Arguments text fields. This is after all just a developer tool. |
I like the idea of the drop-down, but there are a lot of editors out there... |
The existing text boxes would stay, we just add a drop down list of known configs. If people want their editor listed they just make a pull request with the patch to add it. |
Here are the commands for the three common plain text editors on MacOS: General: |
@macfreek awesome! |
To open the linked error file on a line number, requires the TW bin tool 'edit'.
man edit in Terminal shows the options, I used '--separate-windows' as it seems to work best for me.
In conjunction with changing the default editor in testup 'Preferences' to '/Applications/TextWrangler.app'
I edited 'editor.rb' to use TW as shown...
for some reason #{arguments} failed to expand so I used "#{file}:#{line}".
john
The text was updated successfully, but these errors were encountered: