bug-gnu-emacs
[Top][All Lists]
Advanced

[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 chi


From: Yuan Fu
Subject: bug#60301: 29.0.60; Tree sitter fontify region over a range with no children issue
Date: Sat, 24 Dec 2022 18:46:57 -0800

Wilhelm H Kirschbaum <wilhelm@floatpays.co.za> writes:

> 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

Ah, right, thanks for the fix! I applied this change.

Yuan





reply via email to

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