emacs-devel
[Top][All Lists]
Advanced

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

Re: Disable tree-sitter font-locking for smaller ranges


From: Theodor Thornhill
Subject: Re: Disable tree-sitter font-locking for smaller ranges
Date: Mon, 17 Oct 2022 08:33:11 +0200

Yuan Fu <casouri@gmail.com> writes:
>>> 
>>> The image you attached looks perfectly fine to me. Do you not want
>>> to font-lock what’s inside a substitution? I’m not exactly sure what
>>> result you want to archive.
>>> 
>> 
>> All the parens, braces, equal, semicolons should be white, as they
>> would in the source file outside of the template string. But the
>> string outside of the ${...} should be string colored.
>> 
> Ah, I finally get it. How about:
>
> (template_string) @font-lock-string-face
> (template_substitution) @default ; color everything in substitution white
> (template_substitution ["${" "}"] @font-lock-constant-face)
> ;; rest font-lock
>

Yes! That's it! Thanks :)

See attached patch:

Theo


Attachment: 0001-Add-correct-ordering-in-template_substitution.patch
Description: Text Data


reply via email to

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