(e)
| 1220 | }); |
| 1221 | |
| 1222 | function prepareCopyCut(e) { |
| 1223 | if (cm.somethingSelected()) { |
| 1224 | lastCopied = cm.getSelections(); |
| 1225 | if (input.inaccurateSelection) { |
| 1226 | input.prevInput = ""; |
| 1227 | input.inaccurateSelection = false; |
| 1228 | te.value = lastCopied.join("\n"); |
| 1229 | selectInput(te); |
| 1230 | } |
| 1231 | } else { |
| 1232 | var ranges = copyableRanges(cm); |
| 1233 | lastCopied = ranges.text; |
| 1234 | if (e.type == "cut") { |
| 1235 | cm.setSelections(ranges.ranges, null, sel_dontScroll); |
| 1236 | } else { |
| 1237 | input.prevInput = ""; |
| 1238 | te.value = ranges.text.join("\n"); |
| 1239 | selectInput(te); |
| 1240 | } |
| 1241 | } |
| 1242 | if (e.type == "cut") cm.state.cutIncoming = true; |
| 1243 | } |
| 1244 | on(te, "cut", prepareCopyCut); |
| 1245 | on(te, "copy", prepareCopyCut); |
| 1246 |
nothing calls this directly
no test coverage detected