Autoformat removes new-line before EOF #1487
Labels
conclusion: resolved
Issue was resolved
topic: code
Related to content of the project itself
type: imperfection
Perceived defect in any part of project
Describe the problem
The autoformat feature removes the last line's new-line, disturbs all sorts of diff / git tools.
Quoting the C++ standard:
A source file that is not empty and that does not end in a new-line character, or that ends in a splice, shall be processed as if an additional new-line character were appended to the file.
Could this be changed to leave the new-line in place, or maybe even add one if it is missing?
Thanks!
Example:

To reproduce
Press CMD-T and save. Look at the last character in the sketch file.
Expected behavior
Leave the new-line before EOF in place.
Arduino IDE version
2.0-nightly-202209
Operating system
macOS
Operating system version
12.6
Additional context
No response
Issue checklist
The text was updated successfully, but these errors were encountered: