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

Function offsetPos

external/.scrollLibs.js:6426–6432  ·  view source on GitHub ↗
(pos, old, nw)

Source from the content-addressed store, hash-verified

6424 }
6425
6426 function offsetPos(pos, old, nw) {
6427 if (pos.line == old.line) {
6428 return Pos(nw.line, pos.ch - old.ch + nw.ch)
6429 } else {
6430 return Pos(nw.line + (pos.line - old.line), pos.ch)
6431 }
6432 }
6433
6434 // Used by replaceSelections to allow moving the selection to the
6435 // 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