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

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

bug#61374: 30.0.50; Wrong mark-sexp with tree-sitter


From: Ergus
Subject: bug#61374: 30.0.50; Wrong mark-sexp with tree-sitter
Date: Thu, 9 Feb 2023 17:14:03 +0100

On Thu, Feb 09, 2023 at 12:08:49PM +0100, Theodor Thornhill wrote:
Eli Zaretskii <eliz@gnu.org> writes:

From: Theodor Thornhill <theo@thornhill.no>
Cc: spacibba@aol.com, casouri@gmail.com, 61374@debbugs.gnu.org
Date: Thu, 09 Feb 2023 10:41:52 +0100

> Can you show some examples that illustrate these issues?  I'm not sure
> I follow your line of reasoning, and thus cannot understand the
> relevant considerations and decisions, and their expected effects on
> behavior.
>
> Thanks.


consider same code as in the first mail:

{
  vector<int> myvar;
}


If point is before the first curly, C-M-f will move to after the semi.


if "compound_statement" is added to the regexps, it will move to after
the closing curly - all good.

Now if point is at the c in 'vector', now we will also move to after the
closing curly, not the first space or after the semi.

Sounds like the treesit sexp movement doesn't have any notion of the
"level" of the sexp or something?  IOW, it doesn't know about the
"innermost" sexp at point?  If so, can we teach treesit.el about that?


Yes, I think we should too.  I'll look into it.

Hi:

I am not aware of the details in the treesit.el implementation for
emacs, but the treesit-api already provides the ts_node_start_point and
ts_node_end_point functions which are intended for this use.

Are we relying on that?

Or am I missing the point?

Nope, don't think so!

Theo




reply via email to

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