File tree Expand file tree Collapse file tree 1 file changed +4
-14
lines changed Expand file tree Collapse file tree 1 file changed +4
-14
lines changed Original file line number Diff line number Diff line change 77 <key >command </key >
88 <string >#!/usr/bin/env ruby -wKU
99
10- SUPPORT = ENV['TM_SUPPORT_PATH']
11- DIALOG = SUPPORT + '/bin/tm_dialog'
12-
13- require SUPPORT + '/lib/escape'
14- require SUPPORT + '/lib/osx/plist'
10+ require ENV["TM_SUPPORT_PATH"] + "/lib/dialog.rb"
1511
1612functions = `grep -i "^$TM_CURRENT_WORD" "$TM_BUNDLE_SUPPORT"/functions.txt`.split("\n")
1713abort if functions.empty?
1814
1915if functions.size > 1
20- functions = functions.collect {|e| { 'title' => e[/^.+?(?=%|$)/], 'data' => e } }
21- plist = { 'menuItems' => functions }.to_plist
22-
23- io = open("|#{e_sh DIALOG} -u", "r+")
24- io << plist
25- io.close_write
26- res = PropertyList::load(io.read)
27- abort unless res.has_key? 'selectedMenuItem'
28- choice = res['selectedMenuItem']['data']
16+ names = functions.map {|e| e[/^.+?(?=%|$)/] }
17+ abort unless choice = Dialog.menu(names)
18+ choice = functions[choice]
2919else
3020 choice = functions.pop
3121end
You can’t perform that action at this time.
0 commit comments