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

Function replaceRange

external/.scrollLibs.js:7408–7421  ·  view source on GitHub ↗
(doc, code, from, to, origin)

Source from the content-addressed store, hash-verified

7406 }
7407
7408 function replaceRange(doc, code, from, to, origin) {
7409 var assign
7410
7411 if (!to) {
7412 to = from
7413 }
7414 if (cmp(to, from) < 0) {
7415 ;(assign = [to, from]), (from = assign[0]), (to = assign[1])
7416 }
7417 if (typeof code == "string") {
7418 code = doc.splitLines(code)
7419 }
7420 makeChange(doc, { from: from, to: to, text: code, origin: origin })
7421 }
7422
7423 // Rebasing/resetting history to deal with externally-sourced changes
7424

Callers 5

.scrollLibs.jsFile · 0.85
onDropFunction · 0.85
deleteNearSelectionFunction · 0.85
defineOptionsFunction · 0.85
indentLineFunction · 0.85

Calls 2

cmpFunction · 0.85
makeChangeFunction · 0.85

Tested by

no test coverage detected