Auto Format settings

@pert

Auto Formatting is broken in beta 12

Open a new sketch and you get the usual BareMinimum sketch like this

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

Press Ctrl + T and you get this

void setup() {
  // put your setup code here, to run once:
}

void loop() {
  // put your main code here, to run repeatedly:
}

So far so good, although it is not actually in the format that I prefer

Now insert 3 blank lines after the comment in setup() then press ctrl+T again and the loop() function is deleted along with one of the blank lines in setup()

void setup() {
  // put your setup code here, to run once:


}

There is more fun to be had if you add the 3 extra blank lines in setup() before using ctrl+T for the first time as nothing happens, but press ctrl+T again and you are left with

void setup() {
  // put your setup code here, to run once:



}
v

}

After this I stopped looking for problems with Auto formatting

1 Like