<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>Commands/Go to function___.tmCommand</filename>
    </added>
    <added>
      <filename>Commands/Preferences.tmCommand</filename>
    </added>
    <added>
      <filename>Support/nibs/Preferences.nib/designable.nib</filename>
    </added>
    <added>
      <filename>Support/nibs/Preferences.nib/keyedobjects.nib</filename>
    </added>
    <added>
      <filename>Support/preferences.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -11,7 +11,7 @@ WordPress.function_define()&lt;/string&gt;
 	&lt;key&gt;fallbackInput&lt;/key&gt;
 	&lt;string&gt;word&lt;/string&gt;
 	&lt;key&gt;input&lt;/key&gt;
-	&lt;string&gt;selection&lt;/string&gt;
+	&lt;string&gt;none&lt;/string&gt;
 	&lt;key&gt;keyEquivalent&lt;/key&gt;
 	&lt;string&gt;@H&lt;/string&gt;
 	&lt;key&gt;name&lt;/key&gt;</diff>
      <filename>Commands/Definition for Word___.tmCommand</filename>
    </modified>
    <modified>
      <diff>@@ -16,7 +16,7 @@ TextMate.exit_insert_snippet('add_')&lt;/string&gt;
 	&lt;key&gt;input&lt;/key&gt;
 	&lt;string&gt;none&lt;/string&gt;
 	&lt;key&gt;name&lt;/key&gt;
-	&lt;string&gt;add...&lt;/string&gt;
+	&lt;string&gt;add_...&lt;/string&gt;
 	&lt;key&gt;output&lt;/key&gt;
 	&lt;string&gt;insertAsSnippet&lt;/string&gt;
 	&lt;key&gt;scope&lt;/key&gt;</diff>
      <filename>Commands/add___.tmCommand</filename>
    </modified>
    <modified>
      <diff>@@ -3,7 +3,11 @@ require ENV['TM_SUPPORT_PATH'] + '/lib/osx/plist'
 require ENV['TM_SUPPORT_PATH'] + '/lib/exit_codes'
 require ENV['TM_SUPPORT_PATH'] + '/lib/current_word'
 
+
 module WordPress
+  
+  @prefspath = &quot;#{ENV['HOME']}/Library/Preferences/com.macromates.textmate.wordpress.plist&quot;
+  
   def self.wpdb
     # manually built array until I can get proper function/class scraping
     choices = [
@@ -337,10 +341,7 @@ module WordPress
  end
   
   def self.function_define()
-    choices = OSX::PropertyList.load(File.read(ENV['TM_BUNDLE_SUPPORT'] + '/function_defs.plist'))
-    search = Word.current_word('a-zA-Z0-9_')
-    found = choices.find { |i| i['name'] == search }
-    
+    found = self.search_functions_by_name(Word.current_word('a-zA-Z0-9_'))
     if found.is_a?(Hash)
       ret = '&lt;code style=&quot;font-size: 1.2em;&quot;&gt;' + found['definition'] + '&lt;/code&gt;&lt;br /&gt;' + found['file']
     else
@@ -353,6 +354,58 @@ module WordPress
     exit
   end
   
+  # open the function's file and go to line number
+  def self.goto_function()
+    prefs = self.load_prefs
+    style = &quot;font-family: 'Lucida Grande', sans-serif;&quot;
+    
+    found = self.search_functions_by_name(Word.current_word('a-zA-Z0-9_'))
+    if found.is_a?(Hash)
+      fileparts = found['file'].split(', line: ');      
+    else
+      TextMate::UI.tool_tip('&lt;p style=&quot;' + style + '&quot;&gt;Sorry, no definition found. Boo!&lt;/p&gt;', :format =&gt; :html)     
+      exit;
+    end
+    
+    # trailing slash must die!
+    if /\/$/.match(prefs['wp_path'])
+      prefs['wp_path'] = prefs['wp_path'].gsub(/\/$/,'')
+    end
+    
+    filepath = prefs['wp_path'].strip + fileparts[0].strip
+    line = fileparts[1]
+    if File.exist?(filepath)
+      `open &quot;txmt://open?url=file://#{e_url filepath}&amp;line=#{line}&quot;`
+    else
+      TextMate::UI.tool_tip('&lt;p style=&quot;' + style + '&quot;&gt;Something has gone horribly wrong! File not found for function definition!&lt;br /&gt;Check your path to the WordPress install in your preferences (command-option-,).&lt;/p&gt;', :format =&gt; :html)       
+    end
+    
+    exit;
+  end
+  
+  def self.set_pref_warning
+    style = &quot;font-family: 'Lucida Grande', sans-serif;&quot;
+    TextMate::UI.tool_tip('&lt;p style=&quot;' + style + '&quot;&gt;WordPress path not defined. Please set bundle preferences (command-option-,).&lt;/p&gt;', :format =&gt; :html)
+    exit;
+  end
+  
+  def self.load_prefs
+    if File.exist?(@prefspath)
+      plist = OSX::PropertyList::load(File.open(@prefspath,File::RDWR|File::CREAT))
+      if ! defined?(plist['wp_path'])
+        self.set_pref_warning
+      end
+    else
+      self.set_pref_warning
+    end
+    return plist
+  end
+  
+  def self.search_functions_by_name(search)
+    choices = OSX::PropertyList.load(File.read(ENV['TM_BUNDLE_SUPPORT'] + '/function_defs.plist'))
+    found = choices.find { |i| i['name'] == search }
+  end
+  
   # set a user role
   def self.user_can()
     choices = [</diff>
      <filename>Support/common.rb</filename>
    </modified>
    <modified>
      <diff>@@ -8,6 +8,7 @@
 		&lt;array&gt;
 			&lt;string&gt;22F74062-F46E-4574-BFCA-16A3AF8D1D3D&lt;/string&gt;
 			&lt;string&gt;6CFC1235-D53C-481F-8EBB-2345CCC5490E&lt;/string&gt;
+			&lt;string&gt;535797D5-2F26-40E3-A8E1-DBB914B03746&lt;/string&gt;
 			&lt;string&gt;------------------------------------&lt;/string&gt;
 			&lt;string&gt;993317FD-2B2F-499C-89BD-F23F3FA185F3&lt;/string&gt;
 			&lt;string&gt;32E7ECF7-1231-4B12-9734-1BBF0FD86A76&lt;/string&gt;
@@ -20,7 +21,7 @@
 			&lt;string&gt;D47A2961-1BFD-4E89-B734-FC05A3135CDE&lt;/string&gt;
 			&lt;string&gt;------------------------------------&lt;/string&gt;
 			&lt;string&gt;64BCD481-DD67-475F-84B1-273A4E742566&lt;/string&gt;
-			&lt;string&gt;60210349-E311-4D32-9727-10F772342634&lt;/string&gt;
+			&lt;string&gt;AF818C20-A106-4835-9E30-BD837BC86600&lt;/string&gt;
 		&lt;/array&gt;
 		&lt;key&gt;submenus&lt;/key&gt;
 		&lt;dict&gt;
@@ -56,6 +57,7 @@
 			&lt;dict&gt;
 				&lt;key&gt;items&lt;/key&gt;
 				&lt;array&gt;
+					&lt;string&gt;60210349-E311-4D32-9727-10F772342634&lt;/string&gt;
 					&lt;string&gt;E2C66F05-BA7E-483F-8E64-15B6B75E3EA9&lt;/string&gt;
 					&lt;string&gt;2C4AFAAF-DE2A-4B34-9DB6-10F4C35C42CF&lt;/string&gt;
 					&lt;string&gt;23067813-35AB-49D3-A1DE-087686EDC364&lt;/string&gt;
@@ -128,7 +130,6 @@
 	&lt;string&gt;WordPress&lt;/string&gt;
 	&lt;key&gt;ordering&lt;/key&gt;
 	&lt;array&gt;
-		&lt;string&gt;2543E52B-D5CF-4BBE-B793-51F1574EA05F&lt;/string&gt;
 		&lt;string&gt;D351B614-AB48-46DF-88C7-775D448520AB&lt;/string&gt;
 		&lt;string&gt;3E14F56C-C7CF-4F9F-8F69-6FBEC6EC6AD5&lt;/string&gt;
 		&lt;string&gt;1013106C-2B17-4FB0-83FE-246B9C9EBAF8&lt;/string&gt;
@@ -146,9 +147,11 @@
 		&lt;string&gt;7EEC763F-7235-427C-8631-B59CF0182E73&lt;/string&gt;
 		&lt;string&gt;9FAA1D54-692E-4B80-A70A-63F5F1F3071A&lt;/string&gt;
 		&lt;string&gt;052C31E2-E330-4AF7-B748-5EF16541CBE8&lt;/string&gt;
+		&lt;string&gt;535797D5-2F26-40E3-A8E1-DBB914B03746&lt;/string&gt;
 		&lt;string&gt;422F23C5-F58C-418E-9F68-B08C932A12D0&lt;/string&gt;
 		&lt;string&gt;6C30E9F4-06F8-46FC-BE2F-19325E306A11&lt;/string&gt;
 		&lt;string&gt;BB5AC0C8-B1AA-49E0-9B64-2ED927F950AB&lt;/string&gt;
+		&lt;string&gt;AF818C20-A106-4835-9E30-BD837BC86600&lt;/string&gt;
 		&lt;string&gt;107C0A1E-1E28-4635-ADF4-CE70A0777AD8&lt;/string&gt;
 		&lt;string&gt;D94B2F0C-06B8-49A9-95DF-79D31F2CFFEB&lt;/string&gt;
 		&lt;string&gt;5F694673-AC7B-4B7A-B749-B6D368640804&lt;/string&gt;
@@ -169,6 +172,7 @@
 		&lt;string&gt;F1B67B91-6CBF-4124-A607-C50D7BAA464A&lt;/string&gt;
 		&lt;string&gt;76ACE4D0-A91A-454E-92BA-6FDC00234D74&lt;/string&gt;
 		&lt;string&gt;819935E7-6523-4D3A-9220-5E812C650A56&lt;/string&gt;
+		&lt;string&gt;2543E52B-D5CF-4BBE-B793-51F1574EA05F&lt;/string&gt;
 	&lt;/array&gt;
 	&lt;key&gt;uuid&lt;/key&gt;
 	&lt;string&gt;F4EA978F-C21D-485A-8E86-117D82FF60C9&lt;/string&gt;</diff>
      <filename>info.plist</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>06d8f8c89b514c447d4300795e736d3ab756cf27</id>
    </parent>
  </parents>
  <author>
    <name>Shawn Parker</name>
    <email>shawn@topfroggraphics.com</email>
  </author>
  <url>http://github.com/Gipetto/wordpress.tmbundle/commit/f0955de54facf895eaf1145a92b42f6856cc1ecb</url>
  <id>f0955de54facf895eaf1145a92b42f6856cc1ecb</id>
  <committed-date>2009-10-07T06:24:38-07:00</committed-date>
  <authored-date>2009-10-07T06:24:38-07:00</authored-date>
  <message>Adding experimental 'jump to file' feature.</message>
  <tree>de94ee959240068bb2d47f5c999b70b98b8cf9f0</tree>
  <committer>
    <name>Shawn Parker</name>
    <email>shawn@topfroggraphics.com</email>
  </committer>
</commit>
