MCPcopy
hub / github.com/DHTMLX/gantt / offsetPos

Function offsetPos

samples/common/codehighlight/codemirror.js:4657–4662  ·  view source on GitHub ↗
(pos, old, nw)

Source from the content-addressed store, hash-verified

4655 }
4656
4657 function offsetPos(pos, old, nw) {
4658 if (pos.line == old.line)
4659 { return Pos(nw.line, pos.ch - old.ch + nw.ch) }
4660 else
4661 { return Pos(nw.line + (pos.line - old.line), pos.ch) }
4662 }
4663
4664 // Used by replaceSelections to allow moving the selection to the
4665 // start or around the replaced test. Hint may be "start" or "around".

Callers 1

computeReplacedSelFunction · 0.85

Calls 1

PosFunction · 0.85

Tested by

no test coverage detected