(e)
| 7522 | var counter = 0; |
| 7523 | |
| 7524 | function extend(e) { |
| 7525 | var curCount = ++counter; |
| 7526 | var cur = posFromMouse(cm, e, true, behavior.unit == "rectangle"); |
| 7527 | if (!cur) { return } |
| 7528 | if (cmp(cur, lastPos) != 0) { |
| 7529 | cm.curOp.focus = activeElt(); |
| 7530 | extendTo(cur); |
| 7531 | var visible = visibleLines(display, doc); |
| 7532 | if (cur.line >= visible.to || cur.line < visible.from) |
| 7533 | { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e); }}), 150); } |
| 7534 | } else { |
| 7535 | var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0; |
| 7536 | if (outside) { setTimeout(operation(cm, function () { |
| 7537 | if (counter != curCount) { return } |
| 7538 | display.scroller.scrollTop += outside; |
| 7539 | extend(e); |
| 7540 | }), 50); } |
| 7541 | } |
| 7542 | } |
| 7543 | |
| 7544 | function done(e) { |
| 7545 | cm.state.selectingText = false; |
no test coverage detected