MCPcopy Index your code
hub / github.com/DHTMLX/gantt / makeChange

Function makeChange

samples/common/codehighlight/codemirror.js:5260–5280  ·  view source on GitHub ↗
(doc, change, ignoreReadOnly)

Source from the content-addressed store, hash-verified

5258 // Apply a change to a document, and add it to the document's
5259 // history, and propagating it to all linked documents.
5260 function makeChange(doc, change, ignoreReadOnly) {
5261 if (doc.cm) {
5262 if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }
5263 if (doc.cm.state.suppressEdits) { return }
5264 }
5265
5266 if (hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange")) {
5267 change = filterChange(doc, change, true);
5268 if (!change) { return }
5269 }
5270
5271 // Possibly split or suppress the update based on the presence
5272 // of read-only spans in its range.
5273 var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);
5274 if (split) {
5275 for (var i = split.length - 1; i >= 0; --i)
5276 { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [""] : change.text, origin: change.origin}); }
5277 } else {
5278 makeChangeInner(doc, change);
5279 }
5280 }
5281
5282 function makeChangeInner(doc, change) {
5283 if (change.text.length == 1 && change.text[0] == "" && cmp(change.from, change.to) == 0) { return }

Callers 4

replaceRangeFunction · 0.85
codemirror.jsFile · 0.85
applyTextInputFunction · 0.85

Calls 5

operationFunction · 0.85
hasHandlerFunction · 0.85
filterChangeFunction · 0.85
removeReadOnlyRangesFunction · 0.85
makeChangeInnerFunction · 0.85

Tested by

no test coverage detected