Description
Describe the problem
When an existing sketch file is selected during a "Save as.." operation, the IDE asks the user to confirm the overwrite, but does not overwrite regardless of the user's choice.
To reproduce
-
Select File > New from the Arduino IDE menus.
-
Select File > Save as... from the Arduino IDE menus.
-
Save the sketch to a convenient location.
I'll refer to this sketch as "Sketch1", but the name doesn't matter. -
Select File > New from the Arduino IDE menus.
-
Modify the text in the sketch file so it's different from the "Sketch1" sketch.
-
Select File > Save as... from the Arduino IDE menus.
-
Open the folder containing "Sketch1".
-
Click on
Sketch1.ino
-
Click the "Save" button.
A dialog opens:Confirm Save As
Sketch1.ino already exists.
Do you want to replace it? -
Click the Yes button, indicating you want to replace
Sketch1.ino
. -
Open
Sketch1.ino
in a text editor.
🐛 Sketch1.ino
contains the original text it was first saved with.
Expected behavior
When I confirm I want to overwrite the sketch, it should be overwritten.
Arduino IDE version
Original report
2.0.0-beta.3-snapshot.520b3a8
Last verified with
Operating system
Windows
Operating system version
11
Additional context
This also occurs when doing a "Save As..." with "Sketch1". But that requires having "Auto Save" disabled and risks being mistaken for #65.
For this reason, I chose to use two sketches in the demo, which works regardless of the "Auto Save" setting.
This works as expected when using Arduino IDE 1.x.
I also tested this with the build from #211 with the same results I described above.