[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#60301: 29.0.60; Tree sitter fontify region over a range with no chil
From: |
Wilhelm H Kirschbaum |
Subject: |
bug#60301: 29.0.60; Tree sitter fontify region over a range with no children issue |
Date: |
Sat, 24 Dec 2022 18:50:01 +0200 |
User-agent: |
mu4e 1.9.3; emacs 29.0.60 |
Currently when there are no children in a range when calling
treesit--children-covering-range-recurse it will return a node,
but
treesit-font-lock-fontify-region expects a list. This happens when
there
is a chunk of an embedded language within the range.
Something like this fixes the issue for me:
@@ -859,7 +871,10 @@ treesit--children-covering-range-recurse
(push child result))
(setq child (treesit-node-next-sibling child)))
;; If NODE has no child, keep NODE.
- (or result node)))
+
+ ;; Either we have to force a list here or handle
+ ;; the result as either a list or NODE.
+ (or result (list node))))
Wilhelm
- bug#60301: 29.0.60; Tree sitter fontify region over a range with no children issue,
Wilhelm H Kirschbaum <=