[gtksourceview] latex.lang: revert two commits



commit 06e77d27f612a54e67ceed80315f398e4ee22949
Author: Sébastien Wilmet <swilmet informatique-libre be>
Date:   Fri Jul 29 07:20:46 2022 +0200

    latex.lang: revert two commits
    
    Revert "latex.lang: fix bug for environment name (non greedy)"
    This reverts commit c83d75c0214faf161966e9440211c3331bbcbd2e.
    
    Revert "latex.lang: add style for name of class, package and environment"
    This reverts commit 8536d1be1424889a11a229cbfa5c93b38b58beb4.
    
    The two commits were related, since the bug fix was for the first one.
    
    Reasons include:
    - The goal of a *.lang file in GtkSourceView is not to make a file as
      colorful as possible. Adding different colors than normal text there
      don't add much value to me.
      It can even be misleading to add color when it's wrong (the syntax
      would be good, but only with context we would know that it's wrong,
      and doing a full context analysis is beyond the scope of a *.lang
      file, after all it's not a full compiler).
    
    - def:text didn't exist (and it's also a hint that this should be normal
      text, i.e. not highlighted).
    
    The latex class-name, pkg-name and env-name are not used by any standard
    style scheme files, so everything should be good from the GSV point of
    view.

 data/language-specs/latex.lang | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)
---
diff --git a/data/language-specs/latex.lang b/data/language-specs/latex.lang
index af603599..07ef3033 100644
--- a/data/language-specs/latex.lang
+++ b/data/language-specs/latex.lang
@@ -35,9 +35,6 @@
     <style id="inline-math"        name="Inline Math Mode"     map-to="latex:display-math"/>
     <style id="math"               name="Math Mode"            map-to="latex:display-math"/>
     <style id="math-boundary"      name="Math Boundary"        map-to="latex:display-math"/>
-    <style id="class-name"         name="Document class name"  map-to="def:text"/>
-    <style id="pkg-name"           name="Package name"         map-to="def:text"/>
-    <style id="env-name"           name="Environment name"     map-to="def:text"/>
     <style id="include"            name="Include"              map-to="def:keyword"/>
     <style id="common-commands"    name="Command"              map-to="def:keyword"/>
     <style id="command"            name="Command"              map-to="def:keyword"/>
@@ -359,26 +356,23 @@
     <context id="specific-commands">
       <include>
         <context id="documentclass" class="no-spell-check">
-          <match>(\\documentclass)(\[.*\])?(\{(.*)\})?</match>
+          <match>(\\documentclass)(\[.*\])?(\{.*\})?</match>
           <include>
             <context sub-pattern="1" style-ref="common-commands"/>
-            <context sub-pattern="4" style-ref="class-name"/>
           </include>
         </context>
 
         <context id="include" class="no-spell-check">
-          <match>(\\(input|include|includeonly|usepackage))\b(\[.*\])?(\{(.*)\})?</match>
+          <match>(\\(input|include|includeonly|usepackage))\b(\[.*\])?(\{.*\})?</match>
           <include>
             <context sub-pattern="1" style-ref="include"/>
-            <context sub-pattern="5" style-ref="pkg-name"/>
           </include>
         </context>
 
         <context id="begin-end-command" class="no-spell-check">
-          <match>(\\(begin|end))\{(.*?)\}</match>
+          <match>(\\(begin|end))\{.*\}</match>
           <include>
             <context sub-pattern="1" style-ref="common-commands"/>
-            <context sub-pattern="3" style-ref="env-name"/>
           </include>
         </context>
       </include>


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