After the loading of my codemiror code and styles, I added to the header of my web page:
div.CodeMirror-cursors {
visibility: visible;
}
When I click on another pane in my app, if I click while the cursor is shown,
then the cursor freezes (doesn’t blink) and stays shown with the codemirror
pane not focused. But, as you noted above, if you happen to click outside
of codemirror when the blink is ‘off’, you’re out of luck, no cursor shown.
Perhaps there’s some way to use a textmark (or bookmark) when cm is blurred?
I don’t literally need the cursor per se, just something to let me know where the
insertion point is.
My application uses cm for regular text entry but as an additional way to get text
inserted, I have a dialog box, and clicking on buttons in the dialog inserts
various text at the cursor. I want to see that cursor position while the
dialog has the focus, and also after I insert text (at the cursor) from clicking
a button in the dialog box, I want to see that the cursor has changed to
the end of the inserted text.
If textmarks were used for this , I could just mark the char after (or before) the
cursor with a “selection length” of 1 char, but there would be the edge cases of
what if the cursor is at the beginning or end of the text in the editor buffer?
(common cases).
As I have it now with the above css, the visible cursor does indeed follow to
the end of the insertion so it works great IFF the user happens to blur
cm while the cursor blink is visible.
I see in the codemirror.css file:
.cm-animate-fat-cursor {
animation: blink 1.06s steps(1) infinite;
-webkit-animation: blink 1.06s steps(1) infinite;
}
I played a bit with this but didn’t see it change anything.
BTW I am using the Chrome browser and only care about my app working in Chrome.
Thanks for the speedy response.