(e)
| 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; |
no test coverage detected