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

Function makeChangeInner

lib/web/CodeMirror/src/model/changes.js:72–87  ·  view source on GitHub ↗
(doc, change)

Source from the content-addressed store, hash-verified

70}
71
72function makeChangeInner(doc, change) {
73 if (change.text.length == 1 && change.text[0] == "" && cmp(change.from, change.to) == 0) return
74 let selAfter = computeSelAfterChange(doc, change)
75 addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN)
76
77 makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change))
78 let rebased = []
79
80 linkedDocs(doc, (doc, sharedHist) => {
81 if (!sharedHist && indexOf(rebased, doc.history) == -1) {
82 rebaseHist(doc.history, change)
83 rebased.push(doc.history)
84 }
85 makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change))
86 })
87}
88
89// Revert a change stored in a document's history.
90export function makeChangeFromHistory(doc, type, allowSelectionOnly) {

Callers 1

makeChangeFunction · 0.70

Calls 9

cmpFunction · 0.90
computeSelAfterChangeFunction · 0.90
addChangeToHistoryFunction · 0.90
stretchSpansOverChangeFunction · 0.90
linkedDocsFunction · 0.90
indexOfFunction · 0.90
makeChangeSingleDocFunction · 0.70
rebaseHistFunction · 0.70
pushMethod · 0.45

Tested by

no test coverage detected