I'm having trouble with my sketches being automatically updated or reverted unexpectedly and I cant make heads or tails of it.
I make a sketch and save it as project1.ino
i find a bug, reopen and edit the sketch and save as project2.ino
this fixes the issue but creates a whole other problem, so i decide to open project1.ino and find a different way to fix the original bug. but this doesn't open project1.ino, it opens project2.ino. project1.ino doesn't seem to exist anymore.
I doublecheck that autosaving is off, painstakingly edit the sketch so that it more closely resembles what project1.ino was like, and hit 'save as', I type project3.ino and hit save:
"are you sure you want to exit the program without saving?"
what? no? thats the opposite of what i want, I must have hit the wrong button. so i hit cancel. I try 'save as' again and see project3.ino is already in the sketch folder, ok weird, it did work. but to be safe i'm going to save this one as project4.ino and hit ok when it asks if i want to exit. I'll close it and open version 4 again just to make sure it's saving properly. seems to work now i'll try and do more bug fixing and save it as project5.ino.
ok lets try to figure this out, in the sketch folder, i have 5 folders: project1, 2, 3, 4, and 5, inside each folder is a corresponding .ino file.
opening project1 should give me the sketch at its worst, since it hasnt been saved since it was overwritten, project 2 should be the same. projects 3 and 4 should be my best effort to revert back to the original sketch, and project5.ino should be the latest version.
In actuality, opening project1 gives me the latest version, as does opening project2, 3, 4, and 5. the the title at the top of the screen is always project5 regardless of which file i actually try to open. maybe theres a different way to open these files?
If in the IDE i go file > sketchbook > project1 i get a sketch titiled "project1" (which is actually the version that is project2 but that's fine) ok lets use this method to open project3 and check on it: and it opens a sketch called project3 and it appears to be the version of the sketch after i did my best to revert back to the original, great!
so it seems like I can access previous saved versions of my sketch i just have to access them through the file menu instead of clicking the icon in windows file manager. super clunky, but not the end of the world.
now that thats figured out, i can hop back into my actual project. i close all the windows and i open project5 annnnd nope, that opens project3. ok lets try the file>sketchbook method: and now i've openned a sketch titled project5, thats a good sign, and a quick scroll to the bottom and ... wait, what? this is still project3 but its name has been updated to project5. Ive lost all my new code. Ok stay calm, it's only several hours of work and unbelievably infuriating, but i can just redo it all.
Great i've got it sorted out and uploaded to the arduino, everything works perfect. but what do I do with my sketch? do try to save it? or should I 'save as'? if i need to reopen this sketch what do I do? i could click on the file but who knows what version i might get, maybe i start a blank sketch to get the IDE running and then file> sketchbook >projectfinal, will that open the sketch i want or will it save over it with this new blank sketch? should i even risk trying to update the sketch or just live with the bug? should i ever try to do another arduino project again?
Does anybody understand how the saving features of the IDE are suppossed to work? Does anybody else find the IDE to be completely erratic and unpredictable?