I use printf a lot and other quoted (constant) strings. Daily, the IDE will reformat these quoted strings. I have to go back and fix them when I see the output format has been changed. I set it up the way it needs to be and I don't want it "fixed" for me!
Here are two example. There are thousands!
Example 1:
What it should be (and I keep fixing it and it keeps getting destroyed):
Serial.printf("CO2 Sensor TX to %i, Sensor TX to %i\n", MHZ_RXPin, MHZ_TXPin);
What it becomes all by itself (probably because of Ctrl+T):
Serial.printf("CO2 Sensor TX to % i, Sensor TX to % i \n", MHZ_RXPin, MHZ_TXPin);
Example 2:
What it should be (and I keep fixing it and it keeps getting destroyed):
homeTime.setLocation("Asia/Manila");
What it becomes all by itself (probably because of Ctrl+T):
homeTime.setLocation("Asia / Manila");
Please range in Ctrl+T to NOT change quoted strings. They are the way the need to be and are not subject to "fixing"!!!
Using 1.8.19, the current release as of this posting.
It is intermittent. Usually happens one per day or two days. Intermittents are very difficult to find and reproduce. It has not happened today. It also happened on previous releases. I cannot reproduce this at will. I am assuming it is Ctrl+T but am not sure. That's for someone who knows the guts of this IDE to figure out (I hope).
I've seen this happening if you have some sort of a syntax bug in your code and press cmd-T
for example if you are missing an opening " and have other string further down, and you press ctrl-T then it does create a big mess indeed because the parsers does not see the bug and sees as text (likely) what's in between the actual quotes.
For example try pressing ctrl-T on this:
void setup() {
Serial.begin(115200);
Serial.print(F(Ooops I forgot the opening quote"));
Serial.printf("CO2 Sensor TX to %i, Sensor TX to %i\n", MHZ_RXPin, MHZ_TXPin);
}
void loop() {}
you'll see that the second line gets screwed.
When lines are not next to each other and you don't see the mess when you press cmd-T, then you compile and get warned about the issue on the first line. You add the missing double quote and press cmd-T again which fixes the compiling bug but it's too late, you have already formatted the text further down in the wrong way...