cursor: text; on the
CodeMirror-iines class. This makes the cursor become a text cursor over the entire body of the editor, not, as one might expect, just when the pointer is directly over text. I tried just deleting this css rule, and it looks like that results in the cursor only being a text cursor when the pointer is directly over text, as I would expect. But I haven’t tested very deeply to see if deleting the rule might screw some things up. I assume there is a reason it is there in the first place, after all. So what is the story?
It seems to have been inserted in 2012 in patch d77b6a53 without really applying to the topic of the patch.
There’s a precedent in textareas though – Your mouse cursor is a text cursor all over a textarea. And a CodeMirror instance is a very similar UI element, so I do think it’s a good default behavior. If you don’t want it, your best bet is to add your own CSS rule that removes it.
I see, that makes sense. Is it possible to nullify the rule only in the
case the editor is in read-only mode?
The editor currently doesn’t add any class when it’s read-only, so no, you’d have to script that yourself.