Trailing comments break reindenting in C++. The line is not moved and everything after it is then broken.
Here is an example:
void test()
{
int maxX=0;
int thisLine=rubbish;
// previous line reindented ok
int numed = 0; // this line will not reindent correctly
int Ihaveno{crap};
}
This is after doing select all and reindent line. The line with a trailing comment gets left alone and breaks all following indenting. For example if I put a pile of space in front of it I get this…
void test()
{
int maxX=0;
int thisLine=rubbish;
// previous line reindented ok
int numed = 0; // this line will not reindent correctly
int Ihaveno{crap};
}
I am using Sublime Text 4 build 4107 on Centos 7.9. I have deliberately removed any configurations or settings to make sure it isn’t something I’ve done.