Skip to content

Auto Format suggestion for new feature - delete empty lines in editor #2960

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

Closed
JulyJim opened this issue Apr 10, 2015 · 3 comments
Closed

Auto Format suggestion for new feature - delete empty lines in editor #2960

JulyJim opened this issue Apr 10, 2015 · 3 comments
Labels
Component: IDE The Arduino IDE feature request A request to make an enhancement (not a bug fix) Type: Wontfix Arduino has decided that it will not resolve the reported issue or implement the requested feature

Comments

@JulyJim
Copy link

JulyJim commented Apr 10, 2015

In my opinion (!) Auto Format is one of the most neglected and poorly advertised (by site administrators) and useful features of Arduino IDE.

It seems that it could gain more followers if

empty , entire white space empty lines

could be optionally also "auto" deleted.

@Chris--A
Copy link
Contributor

Maybe this would be useful if there are two or more empty lines, and all but one was removed: As removing every empty line may make things worse.

It would also be nice if it could fix the code of newbies who don't like many lines of code:

void setup() {
  Serial.begin(9600);
  Serial.print("hi here is a number ");Serial.print(analogRead(A0),HEX);Serial.print(", and here is the compile time: ");Serial.print(__TIME__);
}

void loop() {

}

Should become

void setup() {
  Serial.begin(9600);
  Serial.print("hi here is a number ");
  Serial.print(analogRead(A0),HEX);
  Serial.print(", and here is the compile time: ");
  Serial.print(__TIME__);
}

void loop() {

}

@ffissore
Copy link
Contributor

IDE uses AStyle for formatting code. Its default conf file is here
As mentioned in the same file, you can copy and customize it to fit your needs.
@Chris--A one of the default option is indeed keep-one-line-statements: removing it make auto format change your example sketch as you wrote it

@VaclavSal another option is delete-empty-lines (which is not enabled by default).

Check them all out at http://astyle.sourceforge.net/astyle.html

@JulyJim
Copy link
Author

JulyJim commented Apr 12, 2015

Thanks, I guess next (silly) question could be - why is this not VISIBLY published?
But that is a different department to ask , right?
Or standard answer is "google it".

@JulyJim JulyJim closed this as completed Apr 12, 2015
@per1234 per1234 added Component: IDE The Arduino IDE feature request A request to make an enhancement (not a bug fix) Type: Wontfix Arduino has decided that it will not resolve the reported issue or implement the requested feature labels Nov 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: IDE The Arduino IDE feature request A request to make an enhancement (not a bug fix) Type: Wontfix Arduino has decided that it will not resolve the reported issue or implement the requested feature
Projects
None yet
Development

No branches or pull requests

4 participants