笙默考试管理系统-MyExamTest----codemirror(17)
目录
一、 笙默考试管理系统-MyExamTest----codemirror
二、 笙默考试管理系统-MyExamTest----codemirror
三、 笙默考试管理系统-MyExamTest----codemirror
四、 笙默考试管理系统-MyExamTest----codemirror
五、 笙默考试管理系统-MyExamTest----codemirror
// Since this is all rather error prone, it is honoured with the
// only assertion in the whole file.
if (lineDiv.childNodes.length != showingTo - showingFrom)
throw new Error("BAD PATCH! " + JSON.stringify(intact) + " size=" + (showingTo - showingFrom) +
" nodes=" + lineDiv.childNodes.length);
if (options.lineWrapping) {
maxWidth = scroller.clientWidth;
var curNode = lineDiv.firstChild;
doc.iter(showingFrom, showingTo, function(line) {
if (!line.hidden) {
var height = Math.round(curNode.offsetHeight / th) || 1;
if (line.height != height) {updateLineHeight(line, height); gutterDirty = true;}
}
curNode = curNode.nextSibling;
});
} else {
if (maxWidth == null) maxWidth = stringWidth(maxLine);
if (maxWidth > scroller.clientWidth) {
lineSpace.style.width = maxWidth + "px";
// Needed to prevent odd wrapping/hiding of widgets placed in here.
code.style.width = "";
code.style.width = scroller.scrollWidth + "px";
} else {
lineSpace.style.width = code.style.width = "";
}
}
gutter.style.display = gutterDisplay;
if (different || gutterDirty) updateGutter();
updateCursor();
if (!suppressCallback && options.onUpdate) options.onUpdate(instance);
return true;
}
function computeIntact(intact, changes) {
for (var i = 0, l = changes.length || 0; i < l; ++i) {
var change = changes[i], intact2 = [], diff = change.diff || 0;
for (var j = 0, l2 = intact.length; j < l2; ++j) {
var range = intact[j];
if (change.to <= range.from && change.diff)
intact2.push({from: range.from + diff, to: range.to + diff,
domStart: range.domStart});
else if (change.to <= range.from || change.from >= range.to)
intact2.push(range);
else {
if (change.from > range.from)
intact2.push({from: range.from, to: change.from, domStart: range.domStart});
if (change.to < range.to)
intact2.push({from: change.to + diff, to: range.to + diff,
domStart: range.domStart + (change.to - range.from)});
}