MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / pasteCommand

Function pasteCommand

src/cm/commandRegistry.js:1339–1352  ·  view source on GitHub ↗
(view)

Source from the content-addressed store, hash-verified

1337}
1338
1339function pasteCommand(view) {
1340 const resolvedView = resolveView(view);
1341 if (!resolvedView) return false;
1342 cordova.plugins.clipboard.paste((text = "") => {
1343 const insertText = String(text);
1344 resolvedView.dispatch(
1345 resolvedView.state.changeByRange((range) => ({
1346 changes: { from: range.from, to: range.to, insert: insertText },
1347 range: EditorSelection.cursor(range.from + insertText.length),
1348 })),
1349 );
1350 });
1351 return true;
1352}
1353
1354function shareCommand(view) {
1355 const resolvedView = resolveView(view);

Callers

nothing calls this directly

Calls 2

resolveViewFunction · 0.85
StringInterface · 0.85

Tested by

no test coverage detected