OK, then if you have the "auto save" feature disabled it is definitely interesting that you aren't experiencing the fault.
So that we can verify your findings, please try this simple experiment
- Select File > New Sketch from the Arduino IDE menus.
A new sketch will open in an Arduino IDE windows - Add the following text to the new sketch:
Hello, world!
- Do not save the sketch.
- Verify that the "dirty" indicator ⬤ is shown to the right of the filename in the editor tab.
- Click the
icon at the top left corner of the screen.
The Apple menu will open. - Select "Sleep" from the Apple menu.
- Wait for your computer to go into sleep mode.
- Wake your computer.
After waking the computer, do you still see the "Hello, world!
" text in the Arduino IDE editor?