(text)
| 581 | }; |
| 582 | |
| 583 | const insertTextAtCursor = (text) => { |
| 584 | if (!text) return; |
| 585 | if (document.queryCommandSupported?.('insertText')) { |
| 586 | document.execCommand('insertText', false, text); |
| 587 | return; |
| 588 | } |
| 589 | |
| 590 | const selection = window.getSelection(); |
| 591 | if (!selection || selection.rangeCount === 0) return; |
| 592 | selection.deleteFromDocument(); |
| 593 | selection.getRangeAt(0).insertNode(document.createTextNode(text)); |
| 594 | selection.collapseToEnd(); |
| 595 | }; |
| 596 | |
| 597 | export const handleEditableDiffPaste = (event) => { |
| 598 | event.preventDefault(); |
no outgoing calls
no test coverage detected