Skip to content

Commit

Permalink
• use Support/lib/tm/detach
Browse files Browse the repository at this point in the history
This has the advantage of catching potential exceptions thrown from the ruby code and show them in a dialog, plus it removes the boilerplate code associated with detaching a command.


git-svn-id: http://svn.textmate.org/trunk/Bundles/TODO.tmbundle@10747 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
  • Loading branch information
sorbits committed Oct 28, 2008
1 parent b8e6657 commit c4bcdbb
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions Commands/Preferences.tmCommand
Original file line number Diff line number Diff line change
@@ -1,26 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!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
STDOUT.reopen('/dev/console', 'w')
STDERR.reopen('/dev/console', 'w')
require ENV['TM_BUNDLE_SUPPORT'] + '/lib/settings.rb'
pid = Process.fork { Settings.show_ui }
Process.detach(pid)
require "#{ENV['TM_SUPPORT_PATH']}/lib/tm/detach"
require "#{ENV['TM_BUNDLE_SUPPORT']}/lib/settings.rb"
TextMate.detach { Settings.show_ui }
</string>
<key>input</key>
<string>none</string>
<key>name</key>
<string>Preferences…</string>
<key>output</key>
<string>discard</string>
<string>showAsTooltip</string>
<key>uuid</key>
<string>65C4098C-BB16-4CA1-9297-B312BCD0433F</string>
</dict>
Expand Down

0 comments on commit c4bcdbb

Please sign in to comment.