(view)
| 1294 | } |
| 1295 | |
| 1296 | function 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 | |
| 1312 | function cutCommand(view) { |
| 1313 | const resolvedView = resolveView(view); |
nothing calls this directly
no test coverage detected