Skip to content

Unsaved changes lost after "**Save As...**" operation #896

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

Closed
per1234 opened this issue Mar 10, 2022 · 1 comment Β· Fixed by #939
Closed

Unsaved changes lost after "**Save As...**" operation #896

per1234 opened this issue Mar 10, 2022 · 1 comment Β· Fixed by #939
Assignees
Labels
conclusion: resolved Issue was resolved criticality: highest Of highest 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 10, 2022

Describe the bug

The IDE give the users the option of two save behaviors, configurable via File > Preferences > ☐ Auto save:

  • πŸ—Ή Auto save - changes to the sketch are saved to disk ~immediately
  • ☐ Auto save - changes to the sketch are stored in memory and saved to disk only when the user explicitly instructs the IDE to do so (e.g., File > Save)

πŸ› Unsaved changes are not written to disk when the user does a "Save As..." operation.

To Reproduce

  1. Select File > Preferences from the Arduino IDE menus.
  2. Uncheck the box next to "☐ Auto save"
  3. Click the OK button.
  4. Select File > New from the Arduino IDE menus.
    ℹ️ The bug is not limited to new sketches. It also occurs with sketches that have been previously saved to a permanent location on the disk.
  5. Make some change to the sketch.
    ❗ Do not save.
  6. Select File > Save As... from the Arduino IDE menus.
  7. Click the Save button.

πŸ› The changes you made are gone.

Expected behavior

Unsaved changes are saved to the target sketch during a "Save As..." operation.

Desktop

  • OS: Windows 10, Ubuntu 20.04
  • Version: 2.0.0-rc4-snapshot-70f1c5f
    Date: 2022-03-09T10:47:19.505Z
    CLI Version: 0.21.0 [10107d24]

Additional context

It is not a matter of the changes being saved to the wrong copy of the sketch. If you start from a previously saved sketch, the unsaved changes will not be in that one either.


This was originally reported at #38, but since the primary focus of that issue has since been resolved I decided it would be best to close #38 and track the remaining part in a dedicated issue.


Also reported at #829 (comment)

@alranel
Copy link
Contributor

alranel commented Apr 26, 2022

I confirm this behavior as of 2.0.0-rc6.
It can be reproduced also by creating a new tab (file), writing something in it and then performing a save: the content of the new tab is lost.

@per1234 per1234 added the conclusion: resolved Issue was resolved label Apr 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved criticality: highest Of highest impact topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants