Subject: Re: bug#78402: treesit after-change-functions

From: Yuan Fu <[email-masked]>
Date: Sun, 1 Jun 2025 15:31:01 -0700

> On May 25, 2025, at 8:55 PM, Yuan Fu <[email-masked]> wrote:
> 
> 
> 
>> On May 22, 2025, at 10:06 AM, Juri Linkov <[email-masked]> wrote:
>> 
>>> @@ -4064,6 +4065,7 @@ treesit-outline-search
>>>  "Search for the next outline heading in the syntax tree.
>>> For BOUND, MOVE, BACKWARD, LOOKING-AT, see the descriptions in
>>> `outline-search-function'."
>>> +  (treesit--pre-redisplay)
>>>  (if looking-at
>>>      (when (treesit-outline--at-point) (pos-bol))
>> 
>> Alas, the same error:
> 
> Gah! Sorry, I don’t have time to properly look into this right now. But I’ll try to find some time as soon as possible (pinky promise).

Hi Juri, how did you produce this error? I tried to use the liquid-generic-ts-mode example in bug#77256 but that didn’t trigger the error.

BTW, I noticed that when tree-sitter-provided outline is in effect, pressing tab on the lines determined as outline titles—like first line of a defun—toggles folding instead of indenting the code. That feels intrusive IMHO. It’s not a problem for “traditional” kind of outline headers in comments, but code is another story.

Take this code as example:

function MyBigFunc(param1
                  param2) {
  const abc = 'def';
  function embed() {
    return true;
  }
}

Right now I can’t indent the embed function, because pressing TAB folds it. Another common practice is to select the whole MyBigFunc function and press TAB to indent everything in the region, that wouldn’t work if point happens to be on the first line, which is common.

Maybe I should create a separate bug report to discuss/address this?

Yuan