(doc, range, head, other)
| 1061 | // Otherwise, simply returns the range between the given positions. |
| 1062 | // Used for cursor motion and such. |
| 1063 | function extendRange(doc, range, head, other) { |
| 1064 | if (doc.cm && doc.cm.display.shift || doc.extend) { |
| 1065 | var anchor = range.anchor; |
| 1066 | if (other) { |
| 1067 | var posBefore = cmp(head, anchor) < 0; |
| 1068 | if (posBefore != (cmp(other, anchor) < 0)) { |
| 1069 | anchor = head; |
| 1070 | head = other; |
| 1071 | } else if (posBefore != (cmp(head, other) < 0)) { |
| 1072 | head = other; |
| 1073 | } |
| 1074 | } |
| 1075 | return new Range(anchor, head); |
| 1076 | } else { |
| 1077 | return new Range(other || head, head); |
| 1078 | } |
| 1079 | } |
| 1080 | |
| 1081 | // Extend the primary selection range, discard the rest. |
| 1082 | function extendSelection(doc, head, other, options) { |
no outgoing calls
no test coverage detected
searching dependent graphs…