MCPcopy Create free account
hub / github.com/csev/py4e / computeSelAfterChange

Function computeSelAfterChange

tools/pythonauto/static/codemirrorepl/codemirror.js:3197–3205  ·  view source on GitHub ↗
(doc, change)

Source from the content-addressed store, hash-verified

3195 }
3196
3197 function computeSelAfterChange(doc, change) {
3198 var out = [];
3199 for (var i = 0; i < doc.sel.ranges.length; i++) {
3200 var range = doc.sel.ranges[i];
3201 out.push(new Range(adjustForChange(range.anchor, change),
3202 adjustForChange(range.head, change)));
3203 }
3204 return normalizeSelection(out, doc.sel.primIndex);
3205 }
3206
3207 function offsetPos(pos, old, nw) {
3208 if (pos.line == old.line)

Callers 3

makeChangeInnerFunction · 0.70
makeChangeFromHistoryFunction · 0.70
makeChangeSingleDocFunction · 0.70

Calls 2

adjustForChangeFunction · 0.85
normalizeSelectionFunction · 0.85

Tested by

no test coverage detected