Open dwelle opened 7 years ago
Thanks for your report. Maybe there is an easy fix for this, but it's quite difficult to reliably position the cursor in contenteditable inputStyle in general, so I don't want to spend time looking into it. The code we currently use definitely has issues and for example doesn't work well with bidirectional content.
@adrianheine yea, I guess it's just another point in the tally against defaulting to contenteditable in the future
Actually, we are indeed working on a rewrite (CodeMirror 6) that will only support contenteditable. However, integration will be much better and we are planning to put a lot of work into issues like these. We are currently raising money for this work: See the announcement for more information about the rewrite and a demo.
Note that CodeMirror 6 is by no means stable or usable in production, yet. It is highly unlikely that we pick up this issue for CodeMirror 5, though.
In
contenteditable
inputStyle, I noticed several cursor bugs when moving cursor around folded code (created viamarkText()
with default options):\n
), cursor is not visible when moved after the marker, as well. Also, this case makes the cursor visibly stay at previous position even if it's already after the marker (e.g. when changing position via click) until after you write a character, see image below:None of this is reproducible in
textarea
. CM version5.26.0
, win7