From 77db3599ba4eaaae3e03217abd57416f09834536 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Fri, 23 Apr 2021 18:42:29 +0900 Subject: [PATCH] Fix C highlighting inconsistencies. --- runtime/queries/c/highlights.scm | 26 +++++++++++++++----------- theme.toml | 5 +++-- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/runtime/queries/c/highlights.scm b/runtime/queries/c/highlights.scm index 04d9a04f3..36fe47d91 100644 --- a/runtime/queries/c/highlights.scm +++ b/runtime/queries/c/highlights.scm @@ -1,3 +1,5 @@ +"goto" @keyword +"register" @keyword "break" @keyword "case" @keyword "const" @keyword @@ -20,15 +22,17 @@ "volatile" @keyword "while" @keyword -"#define" @keyword -"#elif" @keyword -"#else" @keyword -"#endif" @keyword -"#if" @keyword -"#ifdef" @keyword -"#ifndef" @keyword -"#include" @keyword -(preproc_directive) @keyword +[ + "#define" + "#elif" + "#else" + "#endif" + "#if" + "#ifdef" + "#ifndef" + "#include" + (preproc_directive) +] @keyword.directive "--" @operator "-" @operator @@ -47,8 +51,8 @@ ">" @operator "||" @operator -"." @delimiter -";" @delimiter +"." @punctuation.delimiter +";" @punctuation.delimiter (string_literal) @string (system_lib_string) @string diff --git a/theme.toml b/theme.toml index f46ce1a94..0d4e0857f 100644 --- a/theme.toml +++ b/theme.toml @@ -1,12 +1,13 @@ "attribute" = "#dbbfef" # lilac "keyword" = "#eccdba" # almond +"keyword.directive" = "#dbbfef" # lilac -- preprocessor comments (#if in C) "punctuation" = "#a4a0e8" # lavender "punctuation.delimiter" = "#a4a0e8" # lavender "operator" = "#dbbfef" # lilac # "property" = "#a4a0e8" # lavender "property" = "#ffffff" # white -# "variable" = "#a4a0e8" # lavender -"variable" = "#eccdba" # almond +"variable" = "#a4a0e8" # lavender +# "variable" = "#eccdba" # almond TODO: metavariables only "variable.parameter" = "#a4a0e8" # lavender # TODO distinguish type from type.builtin? "type" = "#ffffff" # white