emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

feature/tree-sitter b2ea38ab03 4/8: ; Minor fix in c-ts-mode fontificati


From: Yuan Fu
Subject: feature/tree-sitter b2ea38ab03 4/8: ; Minor fix in c-ts-mode fontification
Date: Mon, 21 Nov 2022 16:38:43 -0500 (EST)

branch: feature/tree-sitter
commit b2ea38ab03e801859163b74a292aa75008e36541
Author: Yuan Fu <casouri@gmail.com>
Commit: Yuan Fu <casouri@gmail.com>

    ; Minor fix in c-ts-mode fontification
    
    * 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 | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el
index 371c6180de..65419cca7d 100644
--- a/lisp/progmodes/c-ts-mode.el
+++ b/lisp/progmodes/c-ts-mode.el
@@ -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'.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]