all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Yuan Fu <casouri@gmail.com>
To: bruce.stephens@isode.com
Cc: Theodor Thornhill <theo@thornhill.no>, 59686@debbugs.gnu.org
Subject: bug#59686: 30.0.50; tree-sitter indentation in some loops and conditional statements is wrong
Date: Thu, 1 Dec 2022 21:13:42 -0800	[thread overview]
Message-ID: <9F4F5716-F492-479A-869F-94D8A9391285@gmail.com> (raw)
In-Reply-To: <ff6f80b5-d94a-1d5e-b47c-1c8d8ecc5506@isode.com>


Bruce Stephens <bruce.stephens@isode.com> writes:

> With the following file I would expect foo(i) to be indented to just two
> indents (like the first one), but they are not. Similarly for many other
> compound statements where the opening spans more than one line.
>
> // -*- c-ts -*-
> int main() {
>    for (int i=0; i<10; ++i) {
>      foo(i);
>    }
>
>    for (int i=0;
>           i<10;
>           ++i) {
>             foo(i);
>           }
> }

I see, that’s because the indent rule finds the BOL of the line where
the "{" is on, and indents from there.  Theo, WDYT? Does indent style 
fix this, or we should change the indent rules?

Yuan





  reply	other threads:[~2022-12-02  5:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-29 18:41 bug#59686: 30.0.50; tree-sitter indentation in some loops and conditional statements is wrong Bruce Stephens
2022-12-02  5:13 ` Yuan Fu [this message]
2022-12-02  5:42   ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-02  8:39     ` Eli Zaretskii
2022-12-02  9:20       ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-02 10:46       ` Bruce Stephens
2022-12-02 11:51         ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-03 10:48 ` Yuan Fu
2022-12-03 11:08   ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-03 11:19     ` Yuan Fu

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9F4F5716-F492-479A-869F-94D8A9391285@gmail.com \
    --to=casouri@gmail.com \
    --cc=59686@debbugs.gnu.org \
    --cc=bruce.stephens@isode.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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.