(e)
| 1258 | }); |
| 1259 | |
| 1260 | function prepareCopyCut(e) { |
| 1261 | if (signalDOMEvent(cm, e)) return |
| 1262 | if (cm.somethingSelected()) { |
| 1263 | lastCopied = cm.getSelections(); |
| 1264 | if (input.inaccurateSelection) { |
| 1265 | input.prevInput = ""; |
| 1266 | input.inaccurateSelection = false; |
| 1267 | te.value = lastCopied.join("\n"); |
| 1268 | selectInput(te); |
| 1269 | } |
| 1270 | } else if (!cm.options.lineWiseCopyCut) { |
| 1271 | return; |
| 1272 | } else { |
| 1273 | var ranges = copyableRanges(cm); |
| 1274 | lastCopied = ranges.text; |
| 1275 | if (e.type == "cut") { |
| 1276 | cm.setSelections(ranges.ranges, null, sel_dontScroll); |
| 1277 | } else { |
| 1278 | input.prevInput = ""; |
| 1279 | te.value = ranges.text.join("\n"); |
| 1280 | selectInput(te); |
| 1281 | } |
| 1282 | } |
| 1283 | if (e.type == "cut") cm.state.cutIncoming = true; |
| 1284 | } |
| 1285 | on(te, "cut", prepareCopyCut); |
| 1286 | on(te, "copy", prepareCopyCut); |
| 1287 |
nothing calls this directly
no test coverage detected