on master help sign in
Fix C highlighting inconsistencies.
commit77db3599ba4eaaae3e03217abd57416f09834536 authorBlaž Hrastnik <blaz@mxxn.io> dateFri 23 Apr 2021, 18:42 (6 years ago) parent7e9ea30
2 files changed+18−13
runtime/queries/c/highlights.scm+15−11 theme.toml+3−2
runtime/queries/c/highlights.scm+15−11
@@ -1,3 +1,5 @@
1+"goto" @keyword
2+"register" @keyword
13"break" @keyword
24"case" @keyword
35"const" @keyword
@@ -20,15 +22,17 @@
2022"volatile" @keyword
2123"while" @keyword
2224
23−"#define" @keyword
24−"#elif" @keyword
25−"#else" @keyword
26−"#endif" @keyword
27−"#if" @keyword
28−"#ifdef" @keyword
29−"#ifndef" @keyword
30−"#include" @keyword
31−(preproc_directive) @keyword
25+[
26+ "#define"
27+ "#elif"
28+ "#else"
29+ "#endif"
30+ "#if"
31+ "#ifdef"
32+ "#ifndef"
33+ "#include"
34+ (preproc_directive)
35+] @keyword.directive
3236
3337"--" @operator
3438"-" @operator
@@ -47,8 +51,8 @@
4751">" @operator
4852"||" @operator
4953
50−"." @delimiter
51−";" @delimiter
54+"." @punctuation.delimiter
55+";" @punctuation.delimiter
5256
5357(string_literal) @string
5458(system_lib_string) @string
theme.toml+3−2
@@ -1,12 +1,13 @@
11"attribute" = "#dbbfef" # lilac
22"keyword" = "#eccdba" # almond
3+"keyword.directive" = "#dbbfef" # lilac -- preprocessor comments (#if in C)
34"punctuation" = "#a4a0e8" # lavender
45"punctuation.delimiter" = "#a4a0e8" # lavender
56"operator" = "#dbbfef" # lilac
67# "property" = "#a4a0e8" # lavender
78"property" = "#ffffff" # white
8−# "variable" = "#a4a0e8" # lavender
9−"variable" = "#eccdba" # almond
9+"variable" = "#a4a0e8" # lavender
10+# "variable" = "#eccdba" # almond TODO: metavariables only
1011"variable.parameter" = "#a4a0e8" # lavender
1112# TODO distinguish type from type.builtin?
1213"type" = "#ffffff" # white