MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / rebaseHistSelSingle

Function rebaseHistSelSingle

lib/web/CodeMirror/src/model/changes.js:279–286  ·  view source on GitHub ↗
(pos, from, to, diff)

Source from the content-addressed store, hash-verified

277// Rebasing/resetting history to deal with externally-sourced changes
278
279function rebaseHistSelSingle(pos, from, to, diff) {
280 if (to < pos.line) {
281 pos.line += diff
282 } else if (from < pos.line) {
283 pos.line = from
284 pos.ch = 0
285 }
286}
287
288// Tries to rebase an array of history events given a change in the
289// document. If the change touches the same lines as the event, the

Callers 1

rebaseHistArrayFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected