MCPcopy
hub / github.com/witheve/Eve / extend

Function extend

src/codemirror.js:3788–3806  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

3786 var counter = 0;
3787
3788 function extend(e) {
3789 var curCount = ++counter;
3790 var cur = posFromMouse(cm, e, true, type == "rect");
3791 if (!cur) return;
3792 if (cmp(cur, lastPos) != 0) {
3793 cm.curOp.focus = activeElt();
3794 extendTo(cur);
3795 var visible = visibleLines(display, doc);
3796 if (cur.line >= visible.to || cur.line < visible.from)
3797 setTimeout(operation(cm, function(){if (counter == curCount) extend(e);}), 150);
3798 } else {
3799 var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;
3800 if (outside) setTimeout(operation(cm, function() {
3801 if (counter != curCount) return;
3802 display.scroller.scrollTop += outside;
3803 extend(e);
3804 }), 50);
3805 }
3806 }
3807
3808 function done(e) {
3809 cm.state.selectingText = false;

Callers 1

leftButtonSelectFunction · 0.85

Calls 5

posFromMouseFunction · 0.85
activeEltFunction · 0.85
extendToFunction · 0.85
visibleLinesFunction · 0.85
operationFunction · 0.85

Tested by

no test coverage detected