Skip to content

"Save As" fails when attempting to replace existing sketch #217

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

Open
per1234 opened this issue Mar 14, 2021 · 0 comments
Open

"Save As" fails when attempting to replace existing sketch #217

per1234 opened this issue Mar 14, 2021 · 0 comments
Assignees
Labels
criticality: medium Of moderate impact topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@per1234
Copy link
Contributor

per1234 commented Mar 14, 2021

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

  1. Select File > New from the Arduino IDE menus.

  2. Select File > Save as... from the Arduino IDE menus.

  3. Save the sketch to a convenient location.
    I'll refer to this sketch as "Sketch1", but the name doesn't matter.

  4. Select File > New from the Arduino IDE menus.

  5. Modify the text in the sketch file so it's different from the "Sketch1" sketch.

  6. Select File > Save as... from the Arduino IDE menus.

  7. Open the folder containing "Sketch1".

  8. Click on Sketch1.ino

  9. Click the "Save" button.
    A dialog opens:

    Confirm Save As

    Sketch1.ino already exists.
    Do you want to replace it?

    Clipboard01

  10. Click the Yes button, indicating you want to replace Sketch1.ino.

  11. 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

9a6a457

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.

Additional reports

@per1234 per1234 added type: bug topic: code Related to content of the project itself labels Mar 14, 2021
@ubidefeo ubidefeo added the priority: medium Resolution is a medium priority label Mar 19, 2021
@cmaglie cmaglie removed the type: bug label Sep 16, 2021
@rsora rsora added the type: imperfection Perceived defect in any part of project label Sep 22, 2021
@rsora rsora added criticality: medium Of moderate impact and removed priority: medium Resolution is a medium priority type: imperfection Perceived defect in any part of project labels Nov 2, 2021
@per1234 per1234 added the type: imperfection Perceived defect in any part of project label Mar 11, 2022
@per1234 per1234 changed the title Overwrite preference is ignored "Save As" fails when attempting to replace existing sketch Mar 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
criticality: medium Of moderate impact topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

5 participants