Skip to content

Commit

Permalink
implicit global objects are replaced with global accessor functions
Browse files Browse the repository at this point in the history
  • Loading branch information
martinh committed Jul 5, 2011
1 parent 01af56a commit 897cc23
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Support/lib/rails/text_mate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ def open_url(url)
`open "#{url}"`
end

# Open a file in textmate using the txmt:// protocol. Uses 0-based line and column indices.
# Open a file in Vico using vicotool. Uses 0-based line and column indices.
def open(filename, line_number = nil, column_number = nil)
filename = filename.filepath if filename.is_a? RailsPath
#options = []
#options << "url=file://#{URI.escape(filename)}"
#options << "line=#{line_number + 1}" if line_number
#options << "column=#{column_number + 1}" if column_number
#open_url "txmt://open?" + options.join("&")
`#{VICO} -e '(window gotoURL:(NSURL fileURLWithPath:"#{filename}") line:#{line_number.to_i} column:#{column_number.to_i})'`
`#{VICO} -e '((current-window) gotoURL:(NSURL fileURLWithPath:"#{filename}") line:#{line_number.to_i + 1} column:#{column_number.to_i})'`
end

# Always return something, or nil, for selected_text
Expand Down

0 comments on commit 897cc23

Please sign in to comment.