So, I’m using the non-default tab-capturing for indenting text with tab.
But! I’d like to display some text in the bottom-right corner of the editor when the editor is focused (small, subtle) saying “press esc to tab out” or something like that.
There’s showDialog but it sounds like that’s already heavier than what you’re looking for. You can have a view plugin add an element to view.dom and style it to look the way you need it to look.
also, I was poking around the docs CodeMirror Reference Manual, and found this for a way to run code on focus change, but how is this static method used?
It’s a facet. You call .of on it and add the result to your configuration. But it is not what you want here—that’s not a generic way to run code on a change, that just sends effects to the state.
Instead, you can use domEventHandlers or, probably even better, just use a style that targets .cm-focused to only show the element when the editor is focused.