MCPcopy Index your code
hub / github.com/Acode-Foundation/Acode / copyCommand

Function copyCommand

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

Source from the content-addressed store, hash-verified

1294}
1295
1296function copyCommand(view) {
1297 const resolvedView = resolveView(view);
1298 if (!resolvedView) return false;
1299 const { state } = resolvedView;
1300 const texts = state.selection.ranges.map((range) => {
1301 if (range.empty) {
1302 const line = state.doc.lineAt(range.head);
1303 return state.doc.sliceString(line.from, line.to);
1304 }
1305 return state.doc.sliceString(range.from, range.to);
1306 });
1307 const textToCopy = texts.join("\n");
1308 cordova.plugins.clipboard.copy(textToCopy);
1309 return true;
1310}
1311
1312function cutCommand(view) {
1313 const resolvedView = resolveView(view);

Callers

nothing calls this directly

Calls 2

resolveViewFunction · 0.85
copyMethod · 0.65

Tested by

no test coverage detected