[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#59686: 30.0.50; tree-sitter indentation in some loops and conditiona
From: |
Yuan Fu |
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 |
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
- bug#59686: 30.0.50; tree-sitter indentation in some loops and conditional statements is wrong,
Yuan Fu <=