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

Function offsetPos

static/mergely/lib/codemirror.js:4305–4310  ·  view source on GitHub ↗
(pos, old, nw)

Source from the content-addressed store, hash-verified

4303 }
4304
4305 function offsetPos(pos, old, nw) {
4306 if (pos.line == old.line)
4307 return Pos(nw.line, pos.ch - old.ch + nw.ch);
4308 else
4309 return Pos(nw.line + (pos.line - old.line), pos.ch);
4310 }
4311
4312 // Used by replaceSelections to allow moving the selection to the
4313 // start or around the replaced test. Hint may be "start" or "around".

Callers 1

computeReplacedSelFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected