Permalink
Browse files

added command to surround with try/catch

  • Loading branch information...
Jason Sallis
Jason Sallis committed Oct 7, 2008
1 parent 08941e6 commit c2b52cab1cc5b1bb9cf72097ee8501ef8da56e8a
Showing with 39 additions and 2 deletions.
  1. +34 −0 Commands/Surround with try:catch.tmCommand
  2. +5 −2 info.plist
@@ -0,0 +1,34 @@
<?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
selected_text = ENV["TM_SELECTED_TEXT"]
if not selected_text.nil?
print "(try\n"
print selected_text
#STDIN.read.split('\n').each {|line| print "#{line}"}
print "\n\t(catch ($1)\n"
print "\t\t$0))"
end</string>
<key>fallbackInput</key>
<string>none</string>
<key>input</key>
<string>none</string>
<key>keyEquivalent</key>
<string>^~@t</string>
<key>name</key>
<string>Surround with try/catch</string>
<key>output</key>
<string>insertAsSnippet</string>
<key>scope</key>
<string>source.nu</string>
<key>uuid</key>
<string>D1E8EEBD-939D-498B-8B68-966C734AA65B</string>
</dict>
</plist>
View
@@ -134,7 +134,6 @@
<string>3F50B291-69C1-4B58-B8AD-847776AFE7E2</string>
<string>3792ECBA-AA86-4EE7-85A5-905C3F5617CD</string>
<string>AA2E381A-6CC9-4FFB-99E2-F8A06AC66627</string>
<string>4CDB4EC3-22A5-4495-BFE5-D722A1DFAD6C</string>
</array>
<key>name</key>
<string>Flow Control</string>
@@ -154,12 +153,15 @@
<dict>
<key>items</key>
<array>
<string>4CDB4EC3-22A5-4495-BFE5-D722A1DFAD6C</string>
<string>D1E8EEBD-939D-498B-8B68-966C734AA65B</string>
<string>------------------------------------</string>
<string>A68D8832-C3F0-46B8-9079-F605CE44E95B</string>
<string>17300953-4B82-48E3-8F71-71C1CF65F987</string>
<string>E8B9E070-D169-4C7E-A717-6737E08F51A7</string>
</array>
<key>name</key>
<string>Exceptions</string>
<string>Exception Handling</string>
</dict>
<key>90AB0ABE-C752-4431-9FDC-1BA75B3CF148</key>
<dict>
@@ -249,6 +251,7 @@
<string>CD9FF10E-B2AD-446C-8580-B050643473CF</string>
<string>D3B3174B-C30D-499A-95E1-62B1C541AD72</string>
<string>E63988FF-4701-4B7B-8877-43621D8AB749</string>
<string>D1E8EEBD-939D-498B-8B68-966C734AA65B</string>
<string>BC242329-75D6-4222-BC4F-43ADD863FCB9</string>
<string>D4C7ED85-CF4C-4C73-B7D5-A2736056DAD9</string>
<string>B6B1CA54-1685-4E75-9DB7-294B0CAA0BA8</string>

0 comments on commit c2b52ca

Please sign in to comment.