No warning of saving when closing IDE

Arduino IDE 2.0.0-beta.3

If there are unsaved changes when the IDE is closed then the changes are saved without warning the user. This is unexpected behaviour. Common user experience is for an application to warn of unsaved changes and offer to save then close, close without saving or do not close.

Hi @riban. Thanks so much for all your excellent feedback!

The situation here is slightly different from what you think, but it essentially has the same result in the case of a new sketch.

Arduino IDE 2.x has a File > Preferences > Auto save setting that is on by default. This is similar to the classic Arduino IDE's File > Preferences > Save when verifying or uploading, except it saves every 500 ms (configurable via the advanced settings). When you create a new sketch, it is stored in a temporary folder. What is different from the classic Arduino IDE is that when this auto-save happens with a new sketch, it doesn't prompt you to save to a standard location. I reported this here:

If you disable auto save, then you will find that the Arduino IDE does prompt you to save when you close the IDE with the sketch in a modified state (aka "dirty"). But with the auto save on the sketch will never be in a modified state so the save prompt is not shown.

Arduino IDE 2.x has a File > Preferences > Auto save setting that is on by default.

I have mixed feelings about this option being turned on by default

Here I am, editing a known working sketch testing out some new ideas that turn out not to be a good idea and the IDE has done an Auto Save so I have lost my known working sketch.

Is there any chance of Auto Save being enhanced to save file versions ?

I don't personally like auto save because I want to have control over if and when my sketches are saved. I always shut it off right away in the classic IDE and do the same in the new IDE (though I actually frequently use both settings because I'm a beta tester). I was bitten by the auto save when I first started using the Arduino IDE and was quite surprised when I discovered this was on by default. Since then, I started using Git version control for most of my projects, so an unintended save is less of a concern, so it's more a matter of getting the behavior I'm accustomed to at this point.

But, for better or worse, the auto save being the default has already been established for many years and so I think changing that default now would not be the right thing to do. For those who do like auto save, I think the new system will be considered a significant improvement. I would much prefer to have the sketch saved immediately rather at intermittent intervals when I happen to compile.

UKHeliBob:
Is there any chance of Auto Save being enhanced to save file versions ?

There is a feature request for this here:

I see it got a lot of support. One of my hopes for this modernization and reworking of the underlying technology of the IDE is that it will make it easier for the Arduino developers and community contributors to improve the IDE. I haven't dived deeply into the Java code base of the classic IDE, and I wouldn't know what I was looking at even if I did, but I get the feeling it has become a bit unwieldy over the years, resulting in it being difficult to make significant changes.

I would much prefer to have the sketch saved immediately rather at intermittent intervals when I happen to compile.

I agree entirely. The "save when compiling or uploading" option being on by default was a bad decision by someone

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.