[gtksourceview/wip/latex-improvements: 1/3] latex.lang: remove "name" style



commit e566f422fa30ff9b98212f538c5fc9379572c8c1
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Fri Jul 29 12:43:27 2016 +0200

    latex.lang: remove "name" style
    
    For example in:
    \documentclass[a4paper,11pt]{report}
    
    "report" was highlighted with the "name" style.
    
    This doesn't add any value. The goal of syntax highlighting is not to
    have the most colorful text as possible. Highlighting the command name
    is sufficient (in the example, \documentclass).
    
    Besides, the value inside the curly braces was highlighted, but there
    was no checks to see if the value is correct. Usually, when something is
    highlighted, it means that it is correct (except with a red background
    or something).

 data/language-specs/latex.lang |   13 ++++---------
 1 files changed, 4 insertions(+), 9 deletions(-)
---
diff --git a/data/language-specs/latex.lang b/data/language-specs/latex.lang
index 498d5ba..1b6ca4a 100644
--- a/data/language-specs/latex.lang
+++ b/data/language-specs/latex.lang
@@ -91,12 +91,10 @@
 
     <context id="R-block" class="no-spell-check">
       <start>(\\begin)\{(Scode|Sinput|Soutput)\}</start>
-      <end>(\\end)\{(\%{2@start})\}</end>
+      <end>(\\end)\{\%{2@start}\}</end>
       <include>
         <context sub-pattern="1" where="start" style-ref="common-commands"/>
-        <context sub-pattern="2" where="start" style-ref="name"/>
         <context sub-pattern="1" where="end" style-ref="common-commands"/>
-        <context sub-pattern="2" where="end" style-ref="name"/>
         <context ref="r:r"/>
       </include>
     </context>
@@ -296,26 +294,23 @@
     <context id="specific-commands">
       <include>
         <context id="documentclass" class="no-spell-check">
-          <match>(\\documentclass)(\[.*\])?\{([a-zA-Z]+)\}</match>
+          <match>(\\documentclass)(\[.*\])?\{[a-zA-Z]+\}</match>
           <include>
             <context sub-pattern="1" style-ref="common-commands"/>
-            <context sub-pattern="3" style-ref="name"/>
           </include>
         </context>
 
         <context id="usepackage" class="no-spell-check">
-          <match>(\\usepackage)(\[.*\])?\{([0-9a-zA-Z,\s]+)\}</match>
+          <match>(\\usepackage)(\[.*\])?\{[0-9a-zA-Z,\s]+\}</match>
           <include>
             <context sub-pattern="1" style-ref="include"/>
-            <context sub-pattern="3" style-ref="name"/>
           </include>
         </context>
 
         <context id="begin-end-command" class="no-spell-check">
-          <match>(\\(begin|end))\{([a-zA-Z0-9]+\*?)\}</match>
+          <match>(\\(begin|end))\{[a-zA-Z0-9]+\*?\}</match>
           <include>
             <context sub-pattern="1" style-ref="common-commands"/>
-            <context sub-pattern="3" style-ref="name"/>
           </include>
         </context>
       </include>


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