-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExtend Class.tmCommand
44 lines (40 loc) · 1.08 KB
/
Extend Class.tmCommand
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?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
require ENV['TM_SUPPORT_PATH'] + "/lib/ui"
class Object
def pass
yield self if block_given?
end
end
STDIN.readlines[ 0, ENV[ 'TM_LINE_NUMBER' ].to_i ].select { |line| line[ /^[a-zA-Z0-9\-]+/ ] }.pass do |s|
# don't offer the current symbol
s[ 0, s.size - 1 ].sort.pass do |symbols|
# let the user choose a symbol to extend
TextMate::UI.menu( symbols ).pass do |choice|
unless choice.nil?
puts "@extend #{symbols[ choice ]}"
end
end
end
end
</string>
<key>input</key>
<string>document</string>
<key>name</key>
<string>Extend Class</string>
<key>output</key>
<string>insertAsSnippet</string>
<key>scope</key>
<string>source.sass4as</string>
<key>tabTrigger</key>
<string>@</string>
<key>uuid</key>
<string>A1A90E2E-F82F-4681-A2A8-18EC4DDDF1A4</string>
</dict>
</plist>