summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Hergert <chergert@redhat.com>2022-01-14 12:08:04 -0800
committerChristian Hergert <chergert@redhat.com>2022-01-14 12:46:43 -0800
commit6d08807ba9c0cd5e027fc4e696d3111f85e8ca0d (patch)
tree00859e20c587c0d382af7ea0e9d2a0d541389742
parente07e406f5f55fe6cf96ff0dd4381a8b70ec2a391 (diff)
downloadgtksourceview-6d08807ba9c0cd5e027fc4e696d3111f85e8ca0d.tar.gz
c.lang: place type keywords in separate style
This allows for styling the type keywords differently (but falling back to the same behavior as before by referencing c:keyword) so that we can make style schemes such as solarized more closely match their upstream counter- parts. For example, in Solarized (VIM at least), `if` and another keywords are green except for typedef/struct/enum/union which are yellow.
-rw-r--r--data/language-specs/c.lang11
1 files changed, 8 insertions, 3 deletions
diff --git a/data/language-specs/c.lang b/data/language-specs/c.lang
index 96489321..ff6df3ae 100644
--- a/data/language-specs/c.lang
+++ b/data/language-specs/c.lang
@@ -38,6 +38,7 @@
<style id="included-file" name="Included File" map-to="def:string"/>
<style id="char" name="Character" map-to="def:character"/>
<style id="keyword" name="Keyword" map-to="def:keyword"/>
+ <style id="type-keyword" name="Type Keyword" map-to="c:keyword"/>
<style id="operator" name="Operator" map-to="def:operator"/>
<style id="type" name="Data Type" map-to="def:type"/>
<style id="storage-class" name="Storage Class" map-to="def:type"/>
@@ -199,17 +200,20 @@
<keyword>default</keyword>
<keyword>do</keyword>
<keyword>else</keyword>
- <keyword>enum</keyword>
<keyword>for</keyword>
<keyword>fortran</keyword>
<keyword>goto</keyword>
<keyword>if</keyword>
<keyword>return</keyword>
- <keyword>struct</keyword>
<keyword>switch</keyword>
+ <keyword>while</keyword>
+ </context>
+
+ <context id="type-keywords" style-ref="type-keyword">
+ <keyword>enum</keyword>
+ <keyword>struct</keyword>
<keyword>typedef</keyword>
<keyword>union</keyword>
- <keyword>while</keyword>
</context>
<context id="operators" style-ref="operator">
@@ -329,6 +333,7 @@
<context ref="invalid-octal"/>
<context ref="decimal"/>
<context ref="keywords"/>
+ <context ref="type-keywords"/>
<context ref="operators"/>
<context ref="types"/>
<context ref="storage-class"/>