diff options
author | Sébastien Wilmet <swilmet@informatique-libre.be> | 2022-07-29 07:20:46 +0200 |
---|---|---|
committer | Sébastien Wilmet <swilmet@informatique-libre.be> | 2022-07-29 07:38:43 +0200 |
commit | 9af53350f1d409085cfde1fea134b5bf71d4fade (patch) | |
tree | f346f2d3a6611872d38b6caa477a5be470fc723a | |
parent | 242a3d9a7ff826c7ffc1d902f249b79fab7613cd (diff) | |
download | gtksourceview-9af53350f1d409085cfde1fea134b5bf71d4fade.tar.gz |
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.
-rw-r--r-- | data/language-specs/latex.lang | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/data/language-specs/latex.lang b/data/language-specs/latex.lang index 335003fa..c91ea124 100644 --- a/data/language-specs/latex.lang +++ b/data/language-specs/latex.lang @@ -34,9 +34,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"/> @@ -358,26 +355,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> |