(e)
| 3764 | var counter = 0; |
| 3765 | |
| 3766 | function extend(e) { |
| 3767 | var curCount = ++counter; |
| 3768 | var cur = posFromMouse(cm, e, true, type == "rect"); |
| 3769 | if (!cur) return; |
| 3770 | if (cmp(cur, lastPos) != 0) { |
| 3771 | cm.curOp.focus = activeElt(); |
| 3772 | extendTo(cur); |
| 3773 | var visible = visibleLines(display, doc); |
| 3774 | if (cur.line >= visible.to || cur.line < visible.from) |
| 3775 | setTimeout(operation(cm, function(){if (counter == curCount) extend(e);}), 150); |
| 3776 | } else { |
| 3777 | var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0; |
| 3778 | if (outside) setTimeout(operation(cm, function() { |
| 3779 | if (counter != curCount) return; |
| 3780 | display.scroller.scrollTop += outside; |
| 3781 | extend(e); |
| 3782 | }), 50); |
| 3783 | } |
| 3784 | } |
| 3785 | |
| 3786 | function done(e) { |
| 3787 | cm.state.selectingText = false; |
no test coverage detected