I am experiencing the same problem. Problem started using version 4.2.
None of my format nor advanced format settings can be saved.
I adjust them, press <OK>, open preferences again; everything looks OK.
Close and restart SQL Developer, open preferences, all my (advanced) format adjustments are gone.
On my other PC however it works OK. Both PC's have same version of SQL Developer and JDK.
Any help on this is appreciated.
maybe try resetting your formatting preferences?
I had mine set to 4, changed to 2, restarted, was still set to 2.
I found a "Reset" button in two places (not sure what the difference is)
* Tools / Preferences / Code Editor / Format / Advanced Format
* Tools / Preferences / Code Editor / Format / Advanced Format / Custom Format
I tried both of them and then tried to set my "Indent Spaces" to 1.
It works fine till I close the app and restart, then it always goes back to 4.
Are there any errors in the log?
The settings are saved in the file o.sqldeveloper/formatterOptions.xml. Do you see the updated <identSpaces>1</identSpaces> value there? If you see the old value, then updating it manually would be a workaround. Alternatively, you can export formatter settings into a directory of your choice, say C:/temp/formatterPrefs.xml, and then copy them over onto o.sqldeveloper/formatterOptions.xml from where it is read on SqlDevelloper restart.
I can see the <identSpaces>1</identSpaces> value in the xml file before opening sql-dev. Then after I open the app, it changes it to 4.