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

Function computeSelAfterChange

static/mergely/lib/codemirror.js:4295–4303  ·  view source on GitHub ↗
(doc, change)

Source from the content-addressed store, hash-verified

4293 }
4294
4295 function computeSelAfterChange(doc, change) {
4296 var out = [];
4297 for (var i = 0; i < doc.sel.ranges.length; i++) {
4298 var range = doc.sel.ranges[i];
4299 out.push(new Range(adjustForChange(range.anchor, change),
4300 adjustForChange(range.head, change)));
4301 }
4302 return normalizeSelection(out, doc.sel.primIndex);
4303 }
4304
4305 function offsetPos(pos, old, nw) {
4306 if (pos.line == old.line)

Callers 3

makeChangeInnerFunction · 0.70
makeChangeFromHistoryFunction · 0.70
makeChangeSingleDocFunction · 0.70

Calls 2

adjustForChangeFunction · 0.70
normalizeSelectionFunction · 0.70

Tested by

no test coverage detected