(e)
| 308 | } |
| 309 | |
| 310 | function done(e) { |
| 311 | cm.state.selectingText = false |
| 312 | counter = Infinity |
| 313 | // If e is null or undefined we interpret this as someone trying |
| 314 | // to explicitly cancel the selection rather than the user |
| 315 | // letting go of the mouse button. |
| 316 | if (e) { |
| 317 | e_preventDefault(e) |
| 318 | display.input.focus() |
| 319 | } |
| 320 | off(display.wrapper.ownerDocument, "mousemove", move) |
| 321 | off(display.wrapper.ownerDocument, "mouseup", up) |
| 322 | doc.history.lastSelOrigin = null |
| 323 | } |
| 324 | |
| 325 | let move = operation(cm, e => { |
| 326 | if (e.buttons === 0 || !e_button(e)) done(e) |
no test coverage detected