[Top][All Lists]

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

Re: tree-sitter: conceptional problem solvable at Emacs' level?

From: Konstantin Kharlamov
Subject: Re: tree-sitter: conceptional problem solvable at Emacs' level?
Date: Sat, 11 Feb 2023 13:25:04 +0300
User-agent: Evolution 3.46.3

On Sat, 2023-02-11 at 12:37 +0300, Konstantin Kharlamov wrote:
> Given this code:
>     int main() {
>         foobar(
>              arg1,
>              arg2
>              );
>     }
> Suppose you put a caret after `arg2` text and press Enter to make a new line
> (all tests are done with `emacs -Q`). The behaviour:
> * c-mode, c++-mode, Sublime Text (both with `.c` and `.cpp` file), VS Code
> (both
> with `.c` and `.cpp` file): creates a new line indented same way as previous
> one.
> * c-ts-mode, c++-ts-mode: re-indents the `arg2` line to have indentation
> different from `arg1,` line, and creates a new line that also has new
> indentation.
> * QtCreator: lol, it does no indentation whatsoever in this case.

Ah, QtCreator does indent, it's just it isn't clear right away due to the way
its GUI behaves. Anyway, it creates a new line with its own indentation (weird
one btw, it is 5 spaces further than the opening parenthesis).

reply via email to

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