I have a really weird bug, in all browser, with my integration of CodeMirror. For some mysterious reason, the first character isn’t highlighted when I use the selectAll command or when I select it by mouse or by keyboard.
I know it is in my integration in my tool since in another context, I have the proper behavior. But I have no clue what to look for so any pointer would be welcome!
Thanks for the pointer, but no, I’m not using markText, I’m just calling selectAll on focus otherwise I let CM manage the selection. It is not even the full first character, just part of it! If I ask what is the selection to CM, it correctly return the full sentence so it is really a visual quirk.
When I find it, I’ll be sure to update that thread.
Could it be that you adjusted the page layout, or a font loaded, after initializing the editor? If so, make sure to call refresh() on it when the layout stabilizes, since it’ll end up using outdated pixel measurements.
That was a good thought and I even had a problem with that earlier, but I’m already doing the refresh after a slight delay to make sure everything is properly loaded. I tried to augment the delay with no luck. Thanks for the pointer!