CodeMirror editor should be blurred when it is not focused

Expected behaviour

I am missing a possibility to “blur” the editor as in remove the cursor focus completely:

  • I’d really like to be able to use the ESC key to blur the CodeMirror instance to have a read-only view until I focus anything again.
  • Focusing the note title should blur the note body

Current behaviour

If I do e.g. “Go”→”Focus”→”Sidebar” the focus is indeed switched to the sidebar but the editor window is not blurred. There is still a CodeMirror `.cm-line` element that has the `.CodeMirror-activeline` class attached to it.

I want ESC to remove the `.CodeMirror-activeline` classes from all elements. Probably CodeMirror exposes a function to do so which should be called whenever the focus is switched to another element. Ideally, it would also be possible to call a CodeMirror.blur() function via a menu entry and shortcut to blur the editor manually.

Usecase

I am using the RichText Plugin from @CalebJohn to hide some markdown. Currently, there is always a line that is active whatever I do which is annoying. I want the complete note to be rendered richly whenever the focus is not in the editor e.g. when I focus the note title.