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

Function extend

tools/pythonauto/static/codemirrorepl/codemirror.js:2677–2695  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

2675 var counter = 0;
2676
2677 function extend(e) {
2678 var curCount = ++counter;
2679 var cur = posFromMouse(cm, e, true, type == "rect");
2680 if (!cur) return;
2681 if (cmp(cur, lastPos) != 0) {
2682 ensureFocus(cm);
2683 extendTo(cur);
2684 var visible = visibleLines(display, doc);
2685 if (cur.line >= visible.to || cur.line < visible.from)
2686 setTimeout(operation(cm, function(){if (counter == curCount) extend(e);}), 150);
2687 } else {
2688 var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;
2689 if (outside) setTimeout(operation(cm, function() {
2690 if (counter != curCount) return;
2691 display.scroller.scrollTop += outside;
2692 extend(e);
2693 }), 50);
2694 }
2695 }
2696
2697 function done(e) {
2698 counter = Infinity;

Callers 1

leftButtonSelectFunction · 0.70

Calls 6

cmpFunction · 0.85
extendToFunction · 0.85
posFromMouseFunction · 0.70
ensureFocusFunction · 0.70
visibleLinesFunction · 0.70
operationFunction · 0.70

Tested by

no test coverage detected