mirror of
https://github.com/arduino/Arduino.git
synced 2025-02-20 14:54:31 +01:00
Added setting for autoformat before saving (editor.autoformat_currentfile_before_saving)
This commit is contained in:
parent
8e0d668344
commit
a15abacc7f
@ -2016,6 +2016,11 @@ public class Editor extends JFrame implements RunnerListener {
|
||||
statusNotice(tr("Saving..."));
|
||||
boolean saved = false;
|
||||
try {
|
||||
if (PreferencesData.getBoolean("editor.autoformat_currentfile_before_saving")) {
|
||||
Tool formatTool = getOrCreateToolInstance("cc.arduino.packages.formatter.AStyle");
|
||||
formatTool.run();
|
||||
}
|
||||
|
||||
boolean wasReadOnly = sketchController.isReadOnly(BaseNoGui.librariesIndexer.getInstalledLibraries(), BaseNoGui.getExamplesPath());
|
||||
String previousMainFilePath = sketch.getMainFilePath();
|
||||
saved = sketchController.save();
|
||||
|
Loading…
x
Reference in New Issue
Block a user