Visual selection of multiline RTL text seems incorrect

If I go to https://codemirror.net/demo/bidi.html and using the mouse, select 1 full line and the first half of the next line, the visual indication of the selection shows that I have selected both lines. However, if I press delete, it will only delete what I actually selected with the mouse.

I tried inspecting the DOM, and could not figure out if the display of the selection is done by CodeMirror. It does not seem that way as I cannot see any spans that align with what is marked.

Does anyone know of a good way of solving this?

I’m not seeing whis. Which text are you selecting, exactly, and which browser are you using?

I am using Chrome 60 (64bit), but seeing the same thing in IE11 (English Windows 8.1).

I made a screen capture here

https://screenpresso.com/=SFaTf

In that video I select with the mouse the text on line 9 and 40% of the text on line 10 (until the period).
CodeMirror shows the selection as if both lines are fully selected, but when I press delete, only the text that I actually marked with the mouse is deleted (the period is kept)

Weird, If I clear the bidi demo and type some all arabic text, it seems to work as it should, but In my local instance setup with the same options (CodeMirror 5.29) I cannot get it to work with any type of text.

Could it be related to this fix: https://github.com/codemirror/CodeMirror/commit/044850a01718d92fd61673dde3b08b1b07ccceb6 ?
In the latest released version (5.29.0) I cannot get it to work at all, whereas in the bidi demo which seems to use latest dev build (5.29.1) it works decently.

Right, this sounds like it might have been fixed by the patch you linked.