-
Notifications
You must be signed in to change notification settings - Fork 28
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
[cpp] bad indentation after macro usage #258
Comments
What would such a macro expand to? Is there anything in C++ that can come between a variable name and its initializer? |
In clang you can put an annotation there, which is used extensively for thread safety analysis: https://abseil.io/docs/cpp/guides/synchronization#annotation-guidelines |
Attached patch should address this case. Regarding your proposal for indentation, that's not something that's easy to build onto this system, and seems like it would often still do the wrong thing. |
I disagree about the indentation. Sure, keeping the same indentation might sometimes do the wrong thing. But resetting indentation to 0 will almost always do the wrong thing. |
There is no code explicitly resetting the indentation to 0. Zero just happens to be the thing that the indentation code computes from the parse context it gets after the parser has tried to recover from unrecognized syntax, which often leads to it discarding some of the rules it is currently trying to parse. |
When pressing enter after the ; the indentation goes to column 0, whereas it should ideally stay at column 2. How about even if the mode doesn't know how to handle a given syntax, it'll fall back on keeping the indentation of the previous line (like when CodeMirror smartIndent = false) rather than always going back to column 0?
The text was updated successfully, but these errors were encountered: