[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#59628: 29.0.50; treesit-beginning/end-of-defun problems in C/C++
From: |
Yuan Fu |
Subject: |
bug#59628: 29.0.50; treesit-beginning/end-of-defun problems in C/C++ |
Date: |
Wed, 30 Nov 2022 15:07:45 -0800 |
Daniel Martín <mardani29@yahoo.es> writes:
> Yuan Fu <casouri@gmail.com> writes:
>
>>
>> Different languages have different grammars that give different names to
>> function definitions and class definitions. So it is necessary to have a
>> regexp variable. Finding such a regexp isn’t too hard, so I don’t think
>> we need a default value. If we do have a default, it would be often wrong,
>> given differences between language grammars.
>
> I see that each major mode sets the value of that buffer-local variable.
> c-ts-mode sets it to "\\(?:definition\\|specifier\\)" but, is that
> correct? In C code, treesit-explore-mode shows function definition
> nodes as "function_definition", so I think the regexp is matching more
> nodes than expected, causing C-M-a C-M-e to move to weird places in the
> buffer.
Right, I’ve fixed the value in 599369bf3a3.
Yuan