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

Function offsetPos

static/editor.md/lib/codemirror/lib/codemirror.js:4126–4131  ·  view source on GitHub ↗
(pos, old, nw)

Source from the content-addressed store, hash-verified

4124 }
4125
4126 function offsetPos(pos, old, nw) {
4127 if (pos.line == old.line)
4128 return Pos(nw.line, pos.ch - old.ch + nw.ch);
4129 else
4130 return Pos(nw.line + (pos.line - old.line), pos.ch);
4131 }
4132
4133 // Used by replaceSelections to allow moving the selection to the
4134 // 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