Permalink
Browse files

Added Return block for entry block command, fixed error in Core Data …

…fetches script and fixed a shortcut
  • Loading branch information...
1 parent d5427c3 commit 50845fa29e334a09d21e262aae8fb0c35a0414ad @Machx committed Jan 8, 2009
@@ -5,19 +5,29 @@
<key>beforeRunningCommand</key>
<string>nop</string>
<key>command</key>
- <string># just to remind you of some useful environment variables
-# see Help / Environment Variables for the full list
-echo File: "$TM_FILEPATH"
-echo Word: "$TM_CURRENT_WORD"
-echo Selection: "$TM_SELECTED_TEXT"</string>
+ <string>#!/usr/bin/env python -S
+
+from os import environ as env
+import re
+
+script_text = env['TM_SELECTED_TEXT']
+
+p = re.compile('entry');
+replaced_text = p.sub('return',script_text);
+
+final_text = '\n\n' + replaced_text;
+
+print final_text;</string>
+ <key>fallbackInput</key>
+ <string>none</string>
<key>input</key>
<string>selection</string>
<key>keyEquivalent</key>
<string>~@m</string>
<key>name</key>
<string>Create Mirror Return Block for Entry Block</string>
<key>output</key>
- <string>replaceSelectedText</string>
+ <string>afterSelectedText</string>
<key>scope</key>
<string>source.d,</string>
<key>uuid</key>
@@ -3,19 +3,24 @@
<plist version="1.0">
<dict>
<key>beforeRunningCommand</key>
- <string>nop</string>
+ <string>saveActiveFile</string>
<key>command</key>
- <string># just to remind you of some useful environment variables
-# see Help / Environment Variables for the full list
-echo File: "$TM_FILEPATH"
-echo Word: "$TM_CURRENT_WORD"
-echo Selection: "$TM_SELECTED_TEXT"</string>
+ <string>#!/bin/bash
+
+osascript &lt;&lt;- APPLESCRIPT
+ tell app "Terminal"
+ launch
+ activate
+ do script "clear; sudo dtrace -s $(esc "${TM_FILEPATH}")"
+ set position of first window to { 100, 100 }
+ end tell
+APPLESCRIPT</string>
<key>input</key>
- <string>selection</string>
+ <string>document</string>
<key>name</key>
<string>Run Script in Terminal</string>
<key>output</key>
- <string>replaceSelectedText</string>
+ <string>discard</string>
<key>uuid</key>
<string>D2E2A3AF-9E53-4074-84A3-52CEA8257DB1</string>
</dict>
@@ -13,7 +13,7 @@
CoreData\$target:CoreData::EndFetch
{
self-&gt;fetchEnd = (vtimestamp - self-&gt; fetchStart) / 1000;
- printf("Fetch Count: %i Duration: %u",arg0,self-&gt;fetchEnd;
+ printf("Fetch Count: %i Duration: %u",arg0,self-&gt;fetchEnd);
ustack();
}</string>
<key>name</key>
@@ -6,8 +6,6 @@
<string>cat usdt.d&gt; "$TM_NEW_FILE"</string>
<key>extension</key>
<string>d</string>
- <key>keyEquivalent</key>
- <string>@`</string>
<key>name</key>
<string>USDT Provider Template</string>
<key>scope</key>

0 comments on commit 50845fa

Please sign in to comment.