MCPcopy Create free account
hub / github.com/TruthHun/BookStack / copyableRanges

Function copyableRanges

static/mergely/lib/codemirror.js:1181–1190  ·  view source on GitHub ↗
(cm)

Source from the content-addressed store, hash-verified

1179 }
1180
1181 function copyableRanges(cm) {
1182 var text = [], ranges = [];
1183 for (var i = 0; i < cm.doc.sel.ranges.length; i++) {
1184 var line = cm.doc.sel.ranges[i].head.line;
1185 var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)};
1186 ranges.push(lineRange);
1187 text.push(cm.getRange(lineRange.anchor, lineRange.head));
1188 }
1189 return {text: text, ranges: ranges};
1190 }
1191
1192 function disableBrowserMagic(field) {
1193 field.setAttribute("autocorrect", "off");

Callers 2

prepareCopyCutFunction · 0.70
onCopyCutFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected