Permalink
Browse files

Give different types of section functions unique scopes

This allows you to target them for styling purposes for instance, etc.
  • Loading branch information...
1 parent d28a139 commit 65eaf2b8efbf466e9075c9f947a25a124b53f3f7 @infininight infininight committed Mar 13, 2013
Showing with 8 additions and 8 deletions.
  1. +2 −2 Preferences/Symbol list.plist
  2. +6 −6 Syntaxes/LaTeX.plist
@@ -1,11 +1,11 @@
<?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>
<string>Symbol List</string>
<key>scope</key>
- <string>text.tex.latex meta.function.section.latex</string>
+ <string>text.tex.latex meta.function.section.*.latex</string>
<key>settings</key>
<dict>
<key>showInSymbolList</key>
View
@@ -126,7 +126,7 @@
<string>(?x)
( # Capture 1
(\\) # Marker
- (?:
+ (
(?:sub){0,2}section # Functions
| (?:sub)?paragraph
| chapter|part|addpart
@@ -151,22 +151,22 @@
<key>name</key>
<string>punctuation.definition.function.latex</string>
</dict>
- <key>3</key>
+ <key>4</key>
<dict>
<key>name</key>
<string>punctuation.definition.arguments.optional.begin.latex</string>
</dict>
- <key>4</key>
+ <key>5</key>
<dict>
<key>name</key>
<string>entity.name.section.latex</string>
</dict>
- <key>5</key>
+ <key>6</key>
<dict>
<key>name</key>
<string>punctuation.definition.arguments.optional.end.latex</string>
</dict>
- <key>6</key>
+ <key>7</key>
<dict>
<key>name</key>
<string>punctuation.definition.arguments.begin.latex</string>
@@ -187,7 +187,7 @@
</dict>
</dict>
<key>name</key>
- <string>meta.function.section.latex</string>
+ <string>meta.function.section.$3.latex</string>
<key>patterns</key>
<array>
<dict>

3 comments on commit 65eaf2b

Contributor

felixjung replied Mar 14, 2013

Hey infininight, this commit appears to have broken syntax highlighting when using math environments such as 'align' in combination with line spacing adjustments. For example, in my LaTeX files containing something like

\begin{align}
  f(a, b) &= (a + b)^2 \\[0.2cm]
            &= a^2 + 2ab + b^2
\end{align}

TM2 will now fail to leave math syntax highlighting in the entire remaining code. If I remove the '[0.2cm]' line height adjustment, code will be highlighted properly. Here is what this looks like in action: http://cl.ly/2d420U0G0q2d

Can you please fix this? Unfortunately it's out of my TM bundle knowledge.

Thanks!

Owner

sorbits replied Mar 14, 2013

Contributor

felixjung replied Mar 14, 2013

Please sign in to comment.