That shouldn’t happen… and I can’t really think of a way in which it could happen. Selection will change color and matching bracket highlighting is removed when the editor blurs, but the syntax coloring should definitely stay.
I’ve only observed syntax highlighting disappearing when something causes the syntax highlighting extension to crash, causing cm6 to disable the plugin. Maybe you have some code that’s causing it to error out.
To help debug, you can add this to your list of extensions and check the developer console for errors the next time your issue happens.
Thank you for the replies! I solved it for now using a hack - I rebuild the editor instance after blurring it. This seems to work - it correctly keep the code syntax highlighted.