MCPcopy Index your code
hub / github.com/csev/py4e / computeIntact

Function computeIntact

tools/pythonauto/static/codemirror/codemirror.js:583–602  ·  view source on GitHub ↗
(intact, changes)

Source from the content-addressed store, hash-verified

581 }
582
583 function computeIntact(intact, changes) {
584 for (var i = 0, l = changes.length || 0; i < l; ++i) {
585 var change = changes[i], intact2 = [], diff = change.diff || 0;
586 for (var j = 0, l2 = intact.length; j < l2; ++j) {
587 var range = intact[j];
588 if (change.to <= range.from && change.diff) {
589 intact2.push({from: range.from + diff, to: range.to + diff});
590 } else if (change.to <= range.from || change.from >= range.to) {
591 intact2.push(range);
592 } else {
593 if (change.from > range.from)
594 intact2.push({from: range.from, to: change.from});
595 if (change.to < range.to)
596 intact2.push({from: change.to + diff, to: range.to + diff});
597 }
598 }
599 intact = intact2;
600 }
601 return intact;
602 }
603
604 function getDimensions(cm) {
605 var d = cm.display, left = {}, width = {};

Callers 1

updateDisplayInnerFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected