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