MCPcopy Create free account
hub / github.com/breck7/scroll / computeSelAfterChange

Function computeSelAfterChange

external/.scrollLibs.js:6417–6424  ·  view source on GitHub ↗
(doc, change)

Source from the content-addressed store, hash-verified

6415 }
6416
6417 function computeSelAfterChange(doc, change) {
6418 var out = []
6419 for (var i = 0; i < doc.sel.ranges.length; i++) {
6420 var range = doc.sel.ranges[i]
6421 out.push(new Range(adjustForChange(range.anchor, change), adjustForChange(range.head, change)))
6422 }
6423 return normalizeSelection(doc.cm, out, doc.sel.primIndex)
6424 }
6425
6426 function offsetPos(pos, old, nw) {
6427 if (pos.line == old.line) {

Callers 3

makeChangeInnerFunction · 0.85
loopFunction · 0.85
makeChangeSingleDocFunction · 0.85

Calls 2

adjustForChangeFunction · 0.85
normalizeSelectionFunction · 0.85

Tested by

no test coverage detected