I found that this file will be formatted into the layout below:
As you can see, commenting out some lines in the above file will cause the comment section not to be left-aligned. I am very confused about this behavior triggered by format-all. Any hints will be appreciated.
I don't have any obvious solutions. What formatter are you using -- clang-format or astyle? I tried both, and I don't get the indentation problem you get.
On Ubuntu 20.04.3 LTS, I installed the git master version of format-all as follows:
Then I opened the following
test.cpp
(c preprocessor) file in Emacs:When I try to comment out the following part in the above file with
M-;
:I found that this file will be formatted into the layout below:
As you can see, commenting out some lines in the above file will cause the comment section not to be left-aligned. I am very confused about this behavior triggered by
format-all
. Any hints will be appreciated.See here for a related discussion.
Regards, HZ