MCPcopy Index your code
hub / github.com/DHTMLX/gantt / prepareCopyCut

Function prepareCopyCut

samples/common/codehighlight/codemirror.js:9333–9351  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

9331 });
9332
9333 function prepareCopyCut(e) {
9334 if (signalDOMEvent(cm, e)) { return }
9335 if (cm.somethingSelected()) {
9336 setLastCopied({lineWise: false, text: cm.getSelections()});
9337 } else if (!cm.options.lineWiseCopyCut) {
9338 return
9339 } else {
9340 var ranges = copyableRanges(cm);
9341 setLastCopied({lineWise: true, text: ranges.text});
9342 if (e.type == "cut") {
9343 cm.setSelections(ranges.ranges, null, sel_dontScroll);
9344 } else {
9345 input.prevInput = "";
9346 te.value = ranges.text.join("\n");
9347 selectInput(te);
9348 }
9349 }
9350 if (e.type == "cut") { cm.state.cutIncoming = +new Date; }
9351 }
9352 on(te, "cut", prepareCopyCut);
9353 on(te, "copy", prepareCopyCut);
9354

Callers

nothing calls this directly

Calls 4

signalDOMEventFunction · 0.85
setLastCopiedFunction · 0.85
copyableRangesFunction · 0.85
selectInputFunction · 0.85

Tested by

no test coverage detected