笙默考试管理系统-MyExamTest----codemirror(44)
目录
笙默考试管理系统-MyExamTest----codemirror(44)
一、 笙默考试管理系统-MyExamTest----codemirror
二、 笙默考试管理系统-MyExamTest----codemirror
三、 笙默考试管理系统-MyExamTest----codemirror
四、 笙默考试管理系统-MyExamTest----codemirror
五、 笙默考试管理系统-MyExamTest----codemirror
function Bookmark(pos) {
this.from = pos; this.to = pos; this.line = null;
}
Bookmark.prototype = {
attach: function(line) { this.line = line; },
detach: function(line) { if (this.line == line) this.line = null; },
split: function(pos, lenBefore) {
if (pos < this.from) {
this.from = this.to = (this.from - pos) + lenBefore;
return this;
}
},
isDead: function() { return this.from > this.to; },
clipTo: function(fromOpen, from, toOpen, to, diff) {
if ((fromOpen || from < this.from) && (toOpen || to > this.to)) {
this.from = 0; this.to = -1;
} else if (this.from > from) {
this.from = this.to = Math.max(to, this.from) + diff;
}
},
sameSet: function(x) { return false; },
find: function() {
if (!this.line || !this.line.parent) return null;
return {line: lineNo(this.line), ch: this.from};
},
clear: function() {
if (this.line) {
var found = indexOf(this.line.marked, this);
if (found != -1) this.line.marked.splice(found, 1);
this.line = null;
}
}
};
// Line objects. These hold state related to a line, including
// highlighting info (the styles array).
function Line(text, styles) {
this.styles = styles || [text, null];
this.text = text;
this.height = 1;
this.marked = this.gutterMarker = this.className = this.handlers = null;
this.stateAfter = this.parent = this.hidden = null;