[gtksourceview] latex: don't use the verbatim style for the verbatim commands (bug #696140).



commit 23d4837215bf40bcdf1d4e2918544b85d50c7e63
Author: Carnë Draug <carandraug+dev gmail com>
Date:   Mon Mar 25 15:45:03 2013 +0000

    latex: don't use the verbatim style for the verbatim commands (bug #696140).

 data/language-specs/latex.lang |   35 ++++++++++++++++-------------------
 1 files changed, 16 insertions(+), 19 deletions(-)
---
diff --git a/data/language-specs/latex.lang b/data/language-specs/latex.lang
index dfc0018..10319b4 100644
--- a/data/language-specs/latex.lang
+++ b/data/language-specs/latex.lang
@@ -256,9 +256,9 @@
                     </include>
                 </context>
 
-                <context id="verbatim-env" style-ref="verbatim" class-disabled="no-spell-check">
+                <context id="verbatim-env" style-inside="true" style-ref="verbatim" 
class-disabled="no-spell-check">
                     <start extended="true">
-                        \\begin\{
+                        (\\begin)\{
                             (
                                 verbatim\*?|
                                 lstlisting|
@@ -266,10 +266,10 @@
                             )
                         \}
                     </start>
-                    <end>\\end\{\%{1 start}\}</end>
+                    <end>(\\end)\{\%{2 start}\}</end>
                     <include>
-                      <context sub-pattern="0" where="start" class="no-spell-check"/>
-                      <context sub-pattern="0" where="end" class="no-spell-check"/>
+                      <context sub-pattern="1" where="start" style-ref="common-commands" 
class="no-spell-check"/>
+                      <context sub-pattern="1" where="end" style-ref="common-commands" 
class="no-spell-check"/>
                     </include>
                 </context>
 
@@ -287,29 +287,26 @@
 
                       If using \verb instead of \lstinline, the brackets annot be used
                     -->
-                <context id="lstinline-brackets" style-ref="verbatim" class-disabled="no-spell-check">
-                    <start>\\lstinline(\[.*?\])?{</start>
+                <context id="lstinline-brackets" style-inside="true" style-ref="verbatim" 
class-disabled="no-spell-check">
+                    <start>(\\lstinline)(\[.*?\])?{</start>
                     <end>}</end>
                     <include>
-                      <context sub-pattern="0" where="start" class="no-spell-check"/>
-                      <context sub-pattern="0" where="end" class="no-spell-check"/>
+                      <context sub-pattern="1" where="start" style-ref="command" class="no-spell-check"/>
                     </include>
                 </context>
-                <context id="lstinline" style-ref="verbatim" class-disabled="no-spell-check">
-                    <start>\\lstinline(\[.*?\])?(\S)</start>
-                    <end>\%{2 start}</end>
+                <context id="lstinline" style-inside="true" style-ref="verbatim" 
class-disabled="no-spell-check">
+                    <start>(\\lstinline)(\[.*?\])?(\S)</start>
+                    <end>\%{3 start}</end>
                     <include>
-                      <context sub-pattern="0" where="start" class="no-spell-check"/>
-                      <context sub-pattern="0" where="end" class="no-spell-check"/>
+                      <context sub-pattern="1" where="start" style-ref="command" class="no-spell-check"/>
                     </include>
                 </context>
                 <!-- If using \verb instead of \lstinline, the brackets cannot be used -->
-                <context id="verbatim-inline" style-ref="verbatim" class-disabled="no-spell-check">
-                    <start>\\verb\*?(\S)</start>
-                    <end>\%{1 start}</end>
+                <context id="verbatim-inline" style-inside="true" style-ref="verbatim" 
class-disabled="no-spell-check">
+                    <start>(\\verb)\*?(\S)</start>
+                    <end>\%{2 start}</end>
                     <include>
-                      <context sub-pattern="0" where="start" class="no-spell-check"/>
-                      <context sub-pattern="0" where="end" class="no-spell-check"/>
+                      <context sub-pattern="1" where="start" style-ref="command" class="no-spell-check"/>
                     </include>
                 </context>
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]