]> git.eshelyaron.com Git - emacs.git/commitdiff
; Minor fix in c-ts-mode fontification
authorYuan Fu <casouri@gmail.com>
Mon, 21 Nov 2022 20:07:20 +0000 (12:07 -0800)
committerYuan Fu <casouri@gmail.com>
Mon, 21 Nov 2022 20:50:40 +0000 (12:50 -0800)
* lisp/progmodes/c-ts-mode.el (c-ts-mode--font-lock-settings): use
override.  Include the outer call_expression.
(c-ts-mode--fontify-defun): Use the override given to it rather than
hard-code.  Add missing space.

lisp/progmodes/c-ts-mode.el

index 371c6180de91098971e7907e4e70c30a615f867f..65419cca7d42a8fb09d0dc22da80ca02012aab72 100644 (file)
@@ -337,8 +337,10 @@ MODE is either `c' or `cpp'."
 
    :language mode
    :feature 'emacs-devel
-   '(((call_expression function: (identifier) @fn)
-      @c-ts-mode--fontify-defun
+   :override t
+   '(((call_expression
+       (call_expression function: (identifier) @fn)
+       @c-ts-mode--fontify-defun)
       (:match "^DEFUN$" @fn)))))
 
 (defun c-ts-mode--fontify-declarator (node override start end &rest args)
@@ -399,12 +401,12 @@ This function corrects the fontification on the colon in
           (treesit-fontify-with-override
            (max start (treesit-node-start type))
            (min end (treesit-node-end type))
-           'font-lock-type-face t))
+           'font-lock-type-face override))
         (when arg
           (treesit-fontify-with-override
-           (max start(treesit-node-start arg))
+           (max start (treesit-node-start arg))
            (min end (treesit-node-end arg))
-           'default t))))))
+           'default override))))))
 
 (defun c-ts-mode--imenu-1 (node)
   "Helper for `c-ts-mode--imenu'.