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

Function extendSelection

tools/pythonauto/static/codemirror/codemirror.js:2562–2579  ·  view source on GitHub ↗
(doc, pos, other, bias)

Source from the content-addressed store, hash-verified

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};

Callers 5

registerEventHandlersFunction · 0.70
onMouseDownFunction · 0.70
doSelectFunction · 0.70
selectLineFunction · 0.70
codemirror.jsFile · 0.70

Calls 2

posLessFunction · 0.70
setSelectionFunction · 0.70

Tested by

no test coverage detected