MCPcopy
hub / github.com/NitroRCr/AIaW / handleCut

Function handleCut

src/utils/codejar.ts:466–479  ·  view source on GitHub ↗
(event: ClipboardEvent)

Source from the content-addressed store, hash-verified

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

Callers 1

CodeJarFunction · 0.85

Calls 5

saveFunction · 0.85
getSelectionFunction · 0.85
doHighlightFunction · 0.85
preventDefaultFunction · 0.85
restoreFunction · 0.70

Tested by

no test coverage detected