(doc, pos, other, bias)
| 2560 | // If shift is held, this will move the selection anchor. Otherwise, |
| 2561 | // it'll set the whole selection. |
| 2562 | function extendSelection(doc, pos, other, bias) { |
| 2563 | if (doc.sel.shift || doc.sel.extend) { |
| 2564 | var anchor = doc.sel.anchor; |
| 2565 | if (other) { |
| 2566 | var posBefore = posLess(pos, anchor); |
| 2567 | if (posBefore != posLess(other, anchor)) { |
| 2568 | anchor = pos; |
| 2569 | pos = other; |
| 2570 | } else if (posBefore != posLess(pos, other)) { |
| 2571 | pos = other; |
| 2572 | } |
| 2573 | } |
| 2574 | setSelection(doc, anchor, pos, bias); |
| 2575 | } else { |
| 2576 | setSelection(doc, pos, other || pos, bias); |
| 2577 | } |
| 2578 | if (doc.cm) doc.cm.curOp.userSelChange = true; |
| 2579 | } |
| 2580 | |
| 2581 | function filterSelectionChange(doc, anchor, head) { |
| 2582 | var obj = {anchor: anchor, head: head}; |
no test coverage detected