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: Yuan Fu
Subject: Re: Disable tree-sitter font-locking for smaller ranges
Date: Mon, 17 Oct 2022 22:06:18 -0700


> On Oct 17, 2022, at 2:41 AM, Theodor Thornhill <theo@thornhill.no> wrote:
> 
> Yuan Fu <casouri@gmail.com> writes:
> 
>> 
>> Actually, thinking more of it, it working relies on the exact order of which 
>> these rules are applied:
>> 1. Outer template_string
>> 2. Outer template_substitution
>> 3. Inner template_string
>> 4. Inner template_substitution
> 
> That's correct.
> 
>> 
>> Relying on such un-guaranteed fact is a bit uncomfortable, so I just
>> wrote a function that did what you suggested initially: to fontify
>> parts of template_string that’s not a template_substitution. WDYT? (I
>> just pushed the change.)
>> 
> 
> I agree! The change looks good to me. Is there any change in performance
> doing this? I'm not yet 100% on the inner workings, but if this would
> slow things down that wouldn't be so nice.

I didn’t do benchmarks, but I’ll be surprised if there are any difference.

Yuan


reply via email to

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