[gtksourceview] latex.lang: improve math highlighting
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview] latex.lang: improve math highlighting
- Date: Thu, 5 Dec 2013 20:54:48 +0000 (UTC)
commit 71499016d8119c63f083b92cf3aa2e3e40ea7579
Author: Sébastien Wilmet <swilmet gnome org>
Date: Thu Dec 5 21:34:06 2013 +0100
latex.lang: improve math highlighting
data/language-specs/latex.lang | 28 ++++++++++++++++++++++++++--
1 files changed, 26 insertions(+), 2 deletions(-)
---
diff --git a/data/language-specs/latex.lang b/data/language-specs/latex.lang
index 3b8111a..3e697b4 100644
--- a/data/language-specs/latex.lang
+++ b/data/language-specs/latex.lang
@@ -338,7 +338,6 @@
<keyword>\}</keyword>
<keyword>~</keyword>
<keyword>\^</keyword>
- <!-- TODO create a spacing context -->
<keyword>\\</keyword>
</context>
</include>
@@ -382,11 +381,36 @@
</match>
</context>
+ <context id="math-spacing" style-ref="special-char">
+ <match>\\[;:!]</match>
+ </context>
+
+ <context id="math-brackets" style-ref="common-commands">
+ <match extended="true">
+ \\(left | right | [bB]igg?[lr]) ( # bracket size specifier
+ \(|\) | \[|\] | \\\{|\\\} | # normal brackets (curly escaped)
+ \| | \\\| | / | \\backslash | # pipe and slashes
+ \\( #-symbol commands
+ [lr]floor | [lr]ceil | [lr]angle | ##
+ ([uU]p(down)?|[dD]own)arrow ##
+ ) ##
+ )
+ </match>
+ </context>
+
+ <context id="math-super-sub-script" style-ref="common-commands">
+ <match>\^|_</match>
+ </context>
+
<context id="in-math" class="no-spell-check">
<include>
+ <context ref="comment"/>
<context ref="math-command"/>
+ <context ref="math-spacing"/>
+ <context ref="math-brackets"/>
+ <context ref="special-char"/>
+ <context ref="math-super-sub-script"/>
<context ref="generic-command"/>
- <!-- more to come -->
</include>
</context>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]