Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 506ea65724
Fetching contributors…

Cannot retrieve contributors at this time

79 lines (72 sloc) 2.165 kB
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>beforeRunningCommand</key>
<string>nop</string>
<key>command</key>
<string>#!/usr/bin/env ruby -wKU
require ENV['TM_SUPPORT_PATH'] + '/lib/textmate.rb'
require ENV['TM_SUPPORT_PATH'] + '/lib/ui.rb'
def header
if ENV.has_key? 'TM_SELECTED_TEXT'
[:all, ENV['TM_SELECTED_TEXT']]
elsif ENV['TM_CURRENT_LINE'] =~ /#\s*(?:include|import)\s*([&lt;"])(.*?)["&gt;]/;
[$1 == '&lt;' ? :system : :user, $2]
else
defaultText = %x{ /usr/bin/pbpaste -pboard find }
header = TextMate::UI.request_string :title =&gt; "Quick Open", :default =&gt; defaultText, :prompt =&gt; "Which header file do you wish to open?"
[:all, header]
end
end
def select_header(headers)
if headers.size &gt; 1
menu = headers.map do |e|
header_name = $&amp; if e =~ /[^\/]+$/
if e =~ /\.framework/
suffix = e.scan(/\/([^\/]+?).framework/).flatten.join(' → ')
else
suffix = File.split(e).first
end
{ 'path' =&gt; e, 'title' =&gt; "#{header_name} — #{suffix}" }
end
if res = TextMate::UI.menu(menu)
res['path']
else
nil
end
else
headers.first
end
end
domain, file = header()
exit if file.nil?
headers = %x{ "$TM_BUNDLE_SUPPORT/bin/headers" -s #{e_sh file} -d #{domain} -C "${TM_DIRECTORY}" }.split("\n")
if header = select_header(headers)
TextMate.go_to :file =&gt; header
elsif headers.empty?
abort "Unable to find ‘#{file}’."
end
</string>
<key>input</key>
<string>none</string>
<key>inputFormat</key>
<string>text</string>
<key>keyEquivalent</key>
<string>@D</string>
<key>name</key>
<string>Quick Open</string>
<key>outputCaret</key>
<string>afterOutput</string>
<key>outputFormat</key>
<string>text</string>
<key>outputLocation</key>
<string>toolTip</string>
<key>scope</key>
<string>source.c, source.objc, source.c++, source.objc++</string>
<key>uuid</key>
<string>FF0E22D6-7D78-11D9-B4DE-000A95A89C98</string>
<key>version</key>
<integer>2</integer>
</dict>
</plist>
Jump to Line
Something went wrong with that request. Please try again.