From 144d8a1db6ec2b945e7dadd77fe5adc3f0afeec1 Mon Sep 17 00:00:00 2001 From: chbk Date: Fri, 21 Feb 2025 18:01:39 +0100 Subject: [PATCH] Improve C and C++ syntax highlighting (#25325) Release Notes: - Improved C and C++ syntax highlighting. | Zed 0.174.6 | With this PR | | --- | --- | | ![Image](https://github.com/user-attachments/assets/fa5bf2e0-c682-4e6a-ab64-bb873579d47c) | ![Image](https://github.com/user-attachments/assets/dc980de9-cd6a-4b0b-8ddc-ac705f687910) | - `NULL`, `nullptr`: `constant` -> `constant.builtin` ```cpp #include int a[] = {true, false}; const int * IDENTIFIER = nullptr; ``` --------- Co-authored-by: Marshall Bowers --- crates/languages/src/c/highlights.scm | 2 +- crates/languages/src/cpp/highlights.scm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/languages/src/c/highlights.scm b/crates/languages/src/c/highlights.scm index ef15a4b345..b80c462ae6 100644 --- a/crates/languages/src/c/highlights.scm +++ b/crates/languages/src/c/highlights.scm @@ -104,7 +104,7 @@ (false) ] @boolean -(null) @constant +(null) @constant.builtin (identifier) @variable diff --git a/crates/languages/src/cpp/highlights.scm b/crates/languages/src/cpp/highlights.scm index 2a8235de1f..b05e8cd6f9 100644 --- a/crates/languages/src/cpp/highlights.scm +++ b/crates/languages/src/cpp/highlights.scm @@ -158,7 +158,7 @@ type :(primitive_type) @type.primitive [ (null) ("nullptr") -] @constant +] @constant.builtin (number_literal) @number