Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

More precise formatting without losing spacing. Compressed is now muc…

…h more compressed and uncompressed expands that compressed code better

git-svn-id: http://svn.textmate.org/trunk/Bundles/CSS.tmbundle@7857 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
  • Loading branch information...
commit bec45dc6a71b2a86ed7622b05d9a4cf2c310b585 1 parent 9a2dc5f
@subtleGradient subtleGradient authored
Showing with 106 additions and 6 deletions.
  1. +102 −2 Macros/Format CSS Compressed.tmMacro
  2. +4 −4 Macros/Format CSS.tmMacro
View
104 Macros/Format CSS Compressed.tmMacro
@@ -14,7 +14,32 @@
<key>findInProjectRegularExpression</key>
<false/>
<key>findString</key>
- <string>\s+</string>
+ <string>\n+</string>
+ <key>ignoreCase</key>
+ <true/>
+ <key>regularExpression</key>
+ <true/>
+ <key>replaceAllScope</key>
+ <string>selection</string>
+ <key>replaceString</key>
+ <string>\n</string>
+ <key>wrapAround</key>
+ <true/>
+ </dict>
+ <key>command</key>
+ <string>findWithOptions:</string>
+ </dict>
+ <dict>
+ <key>argument</key>
+ <dict>
+ <key>action</key>
+ <string>replaceAll</string>
+ <key>findInProjectIgnoreCase</key>
+ <true/>
+ <key>findInProjectRegularExpression</key>
+ <false/>
+ <key>findString</key>
+ <string>[ \t]+</string>
<key>ignoreCase</key>
<true/>
<key>regularExpression</key>
@@ -39,7 +64,32 @@
<key>findInProjectRegularExpression</key>
<false/>
<key>findString</key>
- <string>}</string>
+ <string>(?m)([;:])\s+</string>
+ <key>ignoreCase</key>
+ <true/>
+ <key>regularExpression</key>
+ <true/>
+ <key>replaceAllScope</key>
+ <string>selection</string>
+ <key>replaceString</key>
+ <string>$1</string>
+ <key>wrapAround</key>
+ <true/>
+ </dict>
+ <key>command</key>
+ <string>findWithOptions:</string>
+ </dict>
+ <dict>
+ <key>argument</key>
+ <dict>
+ <key>action</key>
+ <string>replaceAll</string>
+ <key>findInProjectIgnoreCase</key>
+ <true/>
+ <key>findInProjectRegularExpression</key>
+ <false/>
+ <key>findString</key>
+ <string>\s*}\s*</string>
<key>ignoreCase</key>
<true/>
<key>regularExpression</key>
@@ -64,6 +114,56 @@
<key>findInProjectRegularExpression</key>
<false/>
<key>findString</key>
+ <string>\s*{\s*</string>
+ <key>ignoreCase</key>
+ <true/>
+ <key>regularExpression</key>
+ <true/>
+ <key>replaceAllScope</key>
+ <string>selection</string>
+ <key>replaceString</key>
+ <string>{</string>
+ <key>wrapAround</key>
+ <true/>
+ </dict>
+ <key>command</key>
+ <string>findWithOptions:</string>
+ </dict>
+ <dict>
+ <key>argument</key>
+ <dict>
+ <key>action</key>
+ <string>replaceAll</string>
+ <key>findInProjectIgnoreCase</key>
+ <true/>
+ <key>findInProjectRegularExpression</key>
+ <false/>
+ <key>findString</key>
+ <string>[ \t]*,[ \t]*</string>
+ <key>ignoreCase</key>
+ <true/>
+ <key>regularExpression</key>
+ <true/>
+ <key>replaceAllScope</key>
+ <string>selection</string>
+ <key>replaceString</key>
+ <string>,</string>
+ <key>wrapAround</key>
+ <true/>
+ </dict>
+ <key>command</key>
+ <string>findWithOptions:</string>
+ </dict>
+ <dict>
+ <key>argument</key>
+ <dict>
+ <key>action</key>
+ <string>replaceAll</string>
+ <key>findInProjectIgnoreCase</key>
+ <true/>
+ <key>findInProjectRegularExpression</key>
+ <false/>
+ <key>findString</key>
<string>^\s+</string>
<key>ignoreCase</key>
<true/>
View
8 Macros/Format CSS.tmMacro
@@ -33,13 +33,13 @@
<key>argument</key>
<dict>
<key>action</key>
- <string>count</string>
+ <string>replaceAll</string>
<key>findInProjectIgnoreCase</key>
<true/>
<key>findInProjectRegularExpression</key>
<false/>
<key>findString</key>
- <string>(?m)\s*}\s*</string>
+ <string>(?m)\s*}[ \t]*\n?</string>
<key>ignoreCase</key>
<true/>
<key>regularExpression</key>
@@ -64,7 +64,7 @@
<key>findInProjectRegularExpression</key>
<false/>
<key>findString</key>
- <string>(?m)\s*}\s*</string>
+ <string>(?m)\s*{[ \t]*</string>
<key>ignoreCase</key>
<true/>
<key>regularExpression</key>
@@ -72,7 +72,7 @@
<key>replaceAllScope</key>
<string>selection</string>
<key>replaceString</key>
- <string>\n}\n</string>
+ <string> {</string>
<key>wrapAround</key>
<true/>
</dict>
Please sign in to comment.
Something went wrong with that request. Please try again.