(event: ClipboardEvent)
| 462 | } |
| 463 | |
| 464 | function handleCut(event: ClipboardEvent) { |
| 465 | const pos = save() |
| 466 | const selection = getSelection() |
| 467 | const originalEvent = (event as any).originalEvent ?? event |
| 468 | originalEvent.clipboardData.setData('text/plain', selection.toString()) |
| 469 | document.execCommand('delete') |
| 470 | doHighlight(editor) |
| 471 | restore({ |
| 472 | start: Math.min(pos.start, pos.end), |
| 473 | end: Math.min(pos.start, pos.end), |
| 474 | dir: '<-', |
| 475 | }) |
| 476 | preventDefault(event) |
| 477 | } |
| 478 | |
| 479 | function visit(editor: HTMLElement, visitor: (el: Node) => 'stop' | undefined) { |
| 480 | const queue: Node[] = [] |
no test coverage detected