Description
Describe the problem
The "Language" menu of the File > Preferences dialog now offers a selection of seven languages the Arduino IDE user interface can be localized to (#941).
🐛 Any unsaved changes to the sketch are lost after changing this preference.
To reproduce
- Select File > Preferences... from the Arduino IDE menus.
- Uncheck the box next to "
☑
Auto save". - Click the OK button.
- Make some change to the sketch.
❗ Do not save the sketch. - Select File > Preferences... from the Arduino IDE menus.
- Select a different language from the "Language" menu.
- Click the OK button.
🐛 The unsaved change to the sketch is lost when the IDE window reloads.
Expected behavior
Make the unsaved state of the sketch persist through the reload.
-OR-
Present the user with a standard save dialog before doing the reload.
Arduino IDE version
2.0.0-rc5-snapshot-a3640cf
Operating system
Windows, Linux
Operating system version
Windows 10, Ubuntu 20.04
Additional context
I think this will occur for any preference that causes a reload on change, but I didn't find any others that have that behavior currently.
This was not introduced by #953. The unsaved changes were lost even with the reload method used before the change made in that PR.
Issue checklist
- I searched for previous reports in the issue tracker
- I verified the problem still occurs when using the latest nightly build
- My report contains all necessary details