File tree Expand file tree Collapse file tree 1 file changed +18
-3
lines changed
Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Original file line number Diff line number Diff line change 1010
1111word=${TM_SELECTED_TEXT:-$TM_CURRENT_WORD}
1212
13+ if [[ $word = '' ]]; then
14+ cat << -'RUBYEOF' > /tmp/textmate-command-$$.rb
15+ require ENV["TM_SUPPORT_PATH"] + "/lib/ui.rb"
16+ puts TextMate::UI.request_string(
17+ :title => "Documentation for Word / Selection",
18+ :prompt => "Lookup Documentation for: "
19+ ).to_s
20+ RUBYEOF
21+
22+ word=$(ruby18 -wKU /tmp/textmate-command-$$.rb)
23+ rm /tmp/textmate-command-$$.rb
24+ fi
25+
1326try_help () {
1427 if help "$word" &> /dev/null; then
1528 source "$TM_SUPPORT_PATH/lib/webpreview.sh"
@@ -24,10 +37,12 @@ try_help () {
2437 fi
2538}
2639
27- MANSECT=${MANSECT:-2:3:4:5:6:7:8:9} try_help
28- try_help
40+ if [[ $word != '' ]]; then
41+ MANSECT=${MANSECT:-2:3:4:5:6:7:8:9} try_help
42+ try_help
2943
30- echo "Couldn’t find documentation for “${word}”"
44+ echo "Couldn’t find documentation for “${word}”"
45+ fi
3146 </string >
3247 <key >fallbackInput </key >
3348 <string >word </string >
You can’t perform that action at this time.
0 commit comments