]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix #if defined directive fontification in c-ts-mode
authorYuan Fu <casouri@gmail.com>
Thu, 9 May 2024 03:50:24 +0000 (20:50 -0700)
committerEshel Yaron <me@eshelyaron.com>
Fri, 10 May 2024 13:33:34 +0000 (15:33 +0200)
* lisp/progmodes/c-ts-mode.el (c-ts-mode--font-lock-settings): Fontify
each part separately so the identifier isn't overriden.

(cherry picked from commit 80ba6b7b96aad3659675b76a8965788fd0d73476)

lisp/progmodes/c-ts-mode.el

index a81b9e09091aa841d78fd09948e8820814e84cfe..09b2963abd135da8e76c0c0266badd2c5315738e 100644 (file)
@@ -617,8 +617,11 @@ MODE is either `c' or `cpp'."
      (preproc_params
       (identifier) @font-lock-variable-name-face)
 
-     (preproc_defined) @font-lock-preprocessor-face
-     (preproc_defined (identifier) @font-lock-variable-name-face)
+     (preproc_defined
+      "defined" @font-lock-preprocessor-face
+      "(" @font-lock-preprocessor-face
+      (identifier) @font-lock-variable-name-face
+      ")" @font-lock-preprocessor-face)
      [,@c-ts-mode--preproc-keywords] @font-lock-preprocessor-face)
 
    :language mode