MCPcopy Index your code
hub / github.com/csev/py4e / offsetPos

Function offsetPos

tools/pythonauto/static/codemirrorepl/codemirror.js:3207–3212  ·  view source on GitHub ↗
(pos, old, nw)

Source from the content-addressed store, hash-verified

3205 }
3206
3207 function offsetPos(pos, old, nw) {
3208 if (pos.line == old.line)
3209 return Pos(nw.line, pos.ch - old.ch + nw.ch);
3210 else
3211 return Pos(nw.line + (pos.line - old.line), pos.ch);
3212 }
3213
3214 // Used by replaceSelections to allow moving the selection to the
3215 // 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