-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C++ indentation is wrong for access specifiers #7206
Comments
Wanted to say this is also the case on Windows 10 Pro v22H2 (build 19045.2965), running Helix from Command Prompt. Also, it seems more like the editor is not indenting anything following the access specifier. Will investigate further. |
CC @Triton171 Is this a simple oversight in the query or some limitetion of tgenindent code. In know there was some weirdness around c++ and I am not sure if it relates to this |
This is a situation where people format their C++ code differently. The convention that helix supports (and that is also more common in my experience) is: class Foo {
public:
Foo() {
}
} Since there are no official code formatting guidelines for C++, this sort of thing tends to be common there (see also #6235). The current indentation system cannot really handle this (since indent queries don't adapt to the style in the current file). I have an idea how this could be improved which I'd like to implement at some point. There are definitely some tricky details to it but if we think about it carefully, it should essentially be possible to keep the advantages of tree-sitter based indentation while also never being significantly worse than the relative regex-based logic that most other editors use. |
Summary
Closing bracket of class methods in access specifiers is not indented properly.
Reproduction Steps
Create a method after an access specifier and let helix auto indent the closing bracket.
Expected closing bracket to be in-line with the method name.
Helix log
No response
Platform
Linux
Terminal Emulator
foot 1.14.0
Helix Version
helix 23.05 (3a8592a)
The text was updated successfully, but these errors were encountered: