(doc, pos, other, bias)
| 2294 | // If shift is held, this will move the selection anchor. Otherwise, |
| 2295 | // it'll set the whole selection. |
| 2296 | function extendSelection(doc, pos, other, bias) { |
| 2297 | if (doc.sel.shift || doc.sel.extend) { |
| 2298 | var anchor = doc.sel.anchor; |
| 2299 | if (other) { |
| 2300 | var posBefore = posLess(pos, anchor); |
| 2301 | if (posBefore != posLess(other, anchor)) { |
| 2302 | anchor = pos; |
| 2303 | pos = other; |
| 2304 | } else if (posBefore != posLess(pos, other)) { |
| 2305 | pos = other; |
| 2306 | } |
| 2307 | } |
| 2308 | setSelection(doc, anchor, pos, bias); |
| 2309 | } else { |
| 2310 | setSelection(doc, pos, other || pos, bias); |
| 2311 | } |
| 2312 | if (doc.cm) doc.cm.curOp.userSelChange = true; |
| 2313 | } |
| 2314 | |
| 2315 | function filterSelectionChange(doc, anchor, head) { |
| 2316 | var obj = {anchor: anchor, head: head}; |
no test coverage detected