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

Function replaceRange

lib/web/CodeMirror/src/model/changes.js:270–275  ·  view source on GitHub ↗
(doc, code, from, to, origin)

Source from the content-addressed store, hash-verified

268}
269
270export function replaceRange(doc, code, from, to, origin) {
271 if (!to) to = from
272 if (cmp(to, from) < 0) [from, to] = [to, from]
273 if (typeof code == "string") code = doc.splitLines(code)
274 makeChange(doc, {from, to, text: code, origin})
275}
276
277// Rebasing/resetting history to deal with externally-sourced changes
278

Callers 6

Doc.jsFile · 0.90
indentLineFunction · 0.90
pollContentMethod · 0.90
onDropFunction · 0.90
defineOptionsFunction · 0.90
deleteNearSelectionFunction · 0.90

Calls 2

cmpFunction · 0.90
makeChangeFunction · 0.70

Tested by

no test coverage detected