Skip to content

Commit

Permalink
NEW Context Sensitive HTML attribute completion. Bound to space when …
Browse files Browse the repository at this point in the history
…your caret is just before the last > in the opening tag.

git-svn-id: http://macromates.com/svn/Bundles/trunk/Bundles/HTML.tmbundle@7928 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
  • Loading branch information
subtlegradient committed Aug 8, 2007
1 parent 7f390b3 commit 31aad99
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 2 deletions.
35 changes: 35 additions & 0 deletions Commands/CodeCompletion HTML Attributes.tmCommand
@@ -0,0 +1,35 @@
<?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>bundleUUID</key>
<string>467B298F-6227-11D9-BFB1-000D93589AF6</string>
<key>command</key>
<string>#!/usr/bin/env ruby
require "#{ENV['TM_SUPPORT_PATH']}/lib/codecompletion"
print TextmateCodeCompletion.new(
#[%{class=""}, %{id=""}, %{style=""}, %{&lt;img src="/images/"}, %{&lt;img border="0"}, ],
TextmateCompletionsText.new(ENV['TM_COMPLETIONS'],{:split=&gt;','}).to_ary,
STDIN.read,
{:scope=&gt;:html_attributes}
).to_snippet</string>
<key>fallbackInput</key>
<string>line</string>
<key>input</key>
<string>selection</string>
<key>keyEquivalent</key>
<string> </string>
<key>name</key>
<string>CodeCompletion HTML Attributes</string>
<key>output</key>
<string>insertAsSnippet</string>
<key>scope</key>
<string>text.html punctuation.definition.tag -source</string>
<key>tabTrigger</key>
<string>"</string>
<key>uuid</key>
<string>CBD82CF3-74E9-4E7A-B3F6-9348754EB5AA</string>
</dict>
</plist>
24 changes: 24 additions & 0 deletions Preferences/Completions HTML Attributes.tmPreferences

Large diffs are not rendered by default.

11 changes: 10 additions & 1 deletion Preferences/Tag Completions.tmPreferences
@@ -1,5 +1,5 @@
<?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>name</key>
Expand Down Expand Up @@ -101,6 +101,15 @@
<string>ul</string>
<string>var</string>
</array>
<key>shellVariables</key>
<array>
<dict>
<key>name</key>
<string>TM_COMPLETIONS</string>
<key>value</key>
<string>a,abbr,acronym,address,applet,area,b,base,basefont,bdo,big,blockquote,br,button,caption,center,cite,code,col,colgroup,dd,del,dfn,dir,div,dl,dt,em,fieldset,font,form,frame,frameset,h1,h2,h3,h4,h5,h6,head,hr,html,i,iframe,img,input,ins,isindex,kbd,label,legend,li,link,map,menu,meta,noframes,noscript,object,ol,optgroup,option,p,param,pre,q,s,samp,script,select,small,span,strike,strong,style,sub,sup,table,tbody,td,textarea,tfoot,th,thead,title,tr,tt,u,ul,var</string>
</dict>
</array>
</dict>
<key>uuid</key>
<string>4720ADB8-DD17-4F97-A715-AFD72E22CE45</string>
Expand Down
4 changes: 3 additions & 1 deletion info.plist
@@ -1,5 +1,5 @@
<?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>contactEmailRot13</key>
Expand Down Expand Up @@ -241,7 +241,9 @@
<string>73251DBE-EBD2-470F-8148-E6F2EC1A9641</string>
<string>6D6B631D-0D6C-413C-B4FA-1D535CBCE890</string>
<string>3463E85F-F500-49A0-8631-D78ED85F9D60</string>
<string>CBD82CF3-74E9-4E7A-B3F6-9348754EB5AA</string>
<string>4720ADB8-DD17-4F97-A715-AFD72E22CE45</string>
<string>69BD9C8F-15C0-4F67-8B7E-64E48B5E9E71</string>
<string>04332FA8-8157-46C4-9854-8C190FFD96C6</string>
<string>E6F19171-F664-4B4F-92DA-3E15E6CAD35C</string>
<string>26068A55-4C84-409D-BA00-162B55AF6961</string>
Expand Down

0 comments on commit 31aad99

Please sign in to comment.