From: Eli Zaretskii <eliz@gnu.org>
To: "Herman, Geza" <geza.herman@gmail.com>,
Yuan Fu <casouri@gmail.com>,
Theodor Thornhill <theo@thornhill.no>
Cc: 62302@debbugs.gnu.org
Subject: bug#62302: 30.0.50; c/c++ tree sitter forward-sexp problem
Date: Thu, 06 Apr 2023 13:12:01 +0300 [thread overview]
Message-ID: <83jzypqpzi.fsf@gnu.org> (raw)
In-Reply-To: <a7e69482-aa75-4ce6-1c7f-e068256a9616@gmail.com> (geza.herman@gmail.com)
> Date: Mon, 20 Mar 2023 21:40:26 +0100
> From: "Herman, Geza" <geza.herman@gmail.com>
>
> With tree sitter, forward-sexp behaves a little strange. To reproduce:
> - copy the little example program below into a c++-ts-mode buffer
> - move the point to the opening curly brace of "main() {"
> - M-x forward-sexp
>
> This will move the point to the space character in "int a;". But without
> tree sitter, this moves the point to the closing brace of main (I
> believe this is the correct behavior).
>
> I noticed this problem because hideshow behaves strangely with tree sitter:
> - enable hideshow mode (M-x hs-minor-mode)
> - move the point to the same opening brace
> - M-x hs-toggle-hiding
>
> Hideshow should hide the whole body of main, but instead it only hides
> parts of the body, and the buffer ends up like this:
>
> int main() {... a;
> }
> int b;
> }
>
> If I set forward-sexp-function to nil, the problem goes away. I think
> this issue is somewhat related to #60894
>
> Here's the little example program:
>
> int main() {
> if (false) {
> int a;
> }
> int b;
> }
Theo, Yuan: any comments? Can you look into fixing this?
Thanks.
next prev parent reply other threads:[~2023-04-06 10:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-20 20:40 bug#62302: 30.0.50; c/c++ tree sitter forward-sexp problem Herman, Geza
2023-04-06 10:12 ` Eli Zaretskii [this message]
2023-04-06 21:55 ` Yuan Fu
2023-09-05 23:50 ` Stefan Kangas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83jzypqpzi.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=62302@debbugs.gnu.org \
--cc=casouri@gmail.com \
--cc=geza.herman@gmail.com \
--cc=theo@thornhill.no \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).