You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 16, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 16, 2026. It is now read-only.
I try to upgrade CodeMirror from 5.14.2 to 5.49.2 and note that rectangle selection work incorrectly even after use new option : configureMouse : function() { return {unit: "rectangle"};}
In 5.14.2 version we used special option option("alwaysRectangularSelection", false); that we used in method function leftButtonSelect( in condition if ((chromeOS ? e.shiftKey && e.metaKey : e.altKey) || cm.options.alwaysRectangularSelection) {
that help us do such kind of rectangle selection:
I found that in new version it logic can be implemented just by using configureMouse option such way configureMouse : function() { return {unit: "rectangle"};}.
But in case when we start to select from shorter string and end after longer on another shorter, result selection don't include some part of text in 2d line :
After research code, I found that changes with xRel in coordsCharInner method not supported by posFromMouse in condition if (forRect && coords.xRel == 1 && line.length == coords.ch) { because now xRel can be more than 1.
So fix like coords.xRel > 0 help in this situation.
Is there any way around it? Or this fix is correct?
Reacted by dmitrygrigoryev and Stanislav Markevich
Activity
marijnh commentedon Nov 19, 2019
Thanks for debugging that. Your proposed fix makes sense—implemented in attached patch.
Adjust posFromMouse to handle arbitrary xRel field values
Update from master (#1)
Update/5.58.2 (#1)
Adjust posFromMouse to handle arbitrary xRel field values