Skip to content

Commit e6fdc3c

Browse files
cmagliefacchinm
authored andcommitted
Added setting for autoformat before saving (editor.autoformat_currentfile_before_saving)
1 parent 2a5bf0e commit e6fdc3c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Diff for: app/src/processing/app/Editor.java

+5
Original file line numberDiff line numberDiff line change
@@ -2016,6 +2016,11 @@ private boolean handleSave2() {
20162016
statusNotice(tr("Saving..."));
20172017
boolean saved = false;
20182018
try {
2019+
if (PreferencesData.getBoolean("editor.autoformat_currentfile_before_saving")) {
2020+
Tool formatTool = getOrCreateToolInstance("cc.arduino.packages.formatter.AStyle");
2021+
formatTool.run();
2022+
}
2023+
20192024
boolean wasReadOnly = sketchController.isReadOnly(BaseNoGui.librariesIndexer.getInstalledLibraries(), BaseNoGui.getExamplesPath());
20202025
String previousMainFilePath = sketch.getMainFilePath();
20212026
saved = sketchController.save();

0 commit comments

Comments
 (0)