Syntax Colors not saving correctly

feedback://showreport?report_id=44304

Steps: Something is up with the way that Syntax Colors for code editor are saved in the Preferences window. This is a regression as this certainly worked in a previous version.

To be sure of a clean start, I deleted Xojo’s preferences with

defaults delete com.xojo.xojo

Next, I launched Xojo, opened the Preferences window, clicked Coding tab and hit Reset button. After closing the Preferences window and re-opening it, you can see that the colors are now incorrect.

Expected Result:
Colors remain as set when Preferences window is shut

Actual Result:
Most of the colors are incorrect after reopening Preferences

P.S. XojoThemes was working fine until the most recent version or two of Xojo. And then suddenly the same built app was saving the colors incorrectly. I assumed it was a bug in XojoThemes (somehow) but the above suggests it’s Xojo itself. As you can see, I deleted the preferences before I started, to ensure that XojoThemes wasn’t doing something it shouldn’t - it wasn’t.

virtually no changes have been made to reading / writing preferences

I’m sure you are correct but something has changed somewhere. If you follow the steps above, you should be able to see the issue I’m describing.

I just tried some old releases:
2015 R3.1 (and previous versions for years back) - works fine
2015 R4 - works fine
2015 R4.1 - works fine
2016 R1.1 - doesn’t work

Definitely behaving different but a quick perusal of SVN doesn’t how me anything that I can see would cause this

I have a funeral to attend but will look at this later

And already marked as fixed in Feedback! Thanks Norman, you guys rock.

Oddly enough this code has been in place for a while s oI’m not sure what caused things to fail but it was
Found it and it was a minor rearrangement of code