MCPcopy Index your code
hub / github.com/csev/py4e / extendRange

Function extendRange

tools/pythonauto/static/codemirrorepl/codemirror.js:1048–1064  ·  view source on GitHub ↗
(doc, range, head, other)

Source from the content-addressed store, hash-verified

1046 // Otherwise, simply returns the range between the given positions.
1047 // Used for cursor motion and such.
1048 function extendRange(doc, range, head, other) {
1049 if (doc.cm && doc.cm.display.shift || doc.extend) {
1050 var anchor = range.anchor;
1051 if (other) {
1052 var posBefore = cmp(head, anchor) < 0;
1053 if (posBefore != (cmp(other, anchor) < 0)) {
1054 anchor = head;
1055 head = other;
1056 } else if (posBefore != (cmp(head, other) < 0)) {
1057 head = other;
1058 }
1059 }
1060 return new Range(anchor, head);
1061 } else {
1062 return new Range(other || head, head);
1063 }
1064 }
1065
1066 // Extend the primary selection range, discard the rest.
1067 function extendSelection(doc, head, other, options) {

Callers 3

extendSelectionFunction · 0.85
extendSelectionsFunction · 0.85
leftButtonSelectFunction · 0.85

Calls 1

cmpFunction · 0.85

Tested by

no test coverage detected