From 0ff8a5433df68785a2198ab2cad1d4736aafb1e4 Mon Sep 17 00:00:00 2001 From: kpbaks Date: Tue, 3 Feb 2026 22:24:47 +0100 Subject: [PATCH] Highlight builtin diff configuration values in `git-attributes` language --- runtime/queries/git-attributes/highlights.scm | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/runtime/queries/git-attributes/highlights.scm b/runtime/queries/git-attributes/highlights.scm index 0b1415b581b7..9e4cdd67c571 100644 --- a/runtime/queries/git-attributes/highlights.scm +++ b/runtime/queries/git-attributes/highlights.scm @@ -7,3 +7,35 @@ (attribute_unset) @operator (attribute_set_to) @operator + +; Highlight builtin diff configuration +; The list of languages is taken from here https://git-scm.com/docs/gitattributes#_defining_a_custom_hunk_header +(attribute_set_to + (attribute) @operator (#eq? @operator "diff") + (value) @variable.builtin (#any-of? @variable.builtin + "ada" + "bash" + "bibtex" + "cpp" + "csharp" + "css" + "dts" + "elixir" + "fortran" + "fountain" + "golang" + "html" + "java" + "kotlin" + "markdown" + "matlab" + "objc" + "pascal" + "perl" + "php" + "python" + "ruby" + "rust" + "scheme" + "tex" + ))