笙默考试管理系统-MyExamTest----codemirror(38)

笙默考试管理系统-MyExamTest----codemirror( 38

目录

[一、 笙默考试管理系统-MyExamTest](#一、 笙默考试管理系统-MyExamTest)

[二、 笙默考试管理系统-MyExamTest](#二、 笙默考试管理系统-MyExamTest)

[三、 笙默考试管理系统-MyExamTest](#三、 笙默考试管理系统-MyExamTest)

[四、 笙默考试管理系统-MyExamTest](#四、 笙默考试管理系统-MyExamTest)

[五、 笙默考试管理系统-MyExamTest](#五、 笙默考试管理系统-MyExamTest)

  • 笙默考试管理系统-MyExamTest

insertHeight: function(at, lines, height) {

this.size += lines.length;

this.height += height;

for (var i = 0, e = this.children.length; i < e; ++i) {

var child = this.children[i], sz = child.chunkSize();

if (at <= sz) {

  • 笙默考试管理系统-MyExamTest

child.insertHeight(at, lines, height);

if (child.lines && child.lines.length > 50) {

while (child.lines.length > 50) {

var spilled = child.lines.splice(child.lines.length - 25, 25);

var newleaf = new LeafChunk(spilled);

child.height -= newleaf.height;

this.children.splice(i + 1, 0, newleaf);

newleaf.parent = this;

}

  • 笙默考试管理系统-MyExamTest

this.maybeSpill();

}

break;

}

at -= sz;

}

},

maybeSpill: function() {

if (this.children.length <= 10) return;

var me = this;

do {

  • 笙默考试管理系统-MyExamTest

var spilled = me.children.splice(me.children.length - 5, 5);

var sibling = new BranchChunk(spilled);

if (!me.parent) { // Become the parent node

var copy = new BranchChunk(me.children);

copy.parent = me;

me.children = [copy, sibling];

me = copy;

} else {

me.size -= sibling.size;

me.height -= sibling.height;

var myIndex = indexOf(me.parent.children, me);

me.parent.children.splice(myIndex + 1, 0, sibling);

}

  • 笙默考试管理系统-MyExamTest

sibling.parent = me.parent;

} while (me.children.length > 10);

me.parent.maybeSpill();

},

iter: function(from, to, op) { this.iterN(from, to - from, op); },

iterN: function(at, n, op) {

for (var i = 0, e = this.children.length; i < e; ++i) {

var child = this.children[i], sz = child.chunkSize();

if (at < sz) {

var used = Math.min(n, sz - at);

if (child.iterN(at, used, op)) return true;

if ((n -= used) == 0) break;

at = 0;

} else at -= sz;

}

}

};

function getLineAt(chunk, n) {

while (!chunk.lines) {

for (var i = 0;; ++i) {

var child = chunk.children[i], sz = child.chunkSize();

if (n < sz) { chunk = child; break; }

n -= sz;

}

}

相关推荐
董世昌413 分钟前
添加、删除、替换、插入元素的全方法指南
java·开发语言·前端
小当家.1059 分钟前
JVM八股详解(上部):核心原理与内存管理
java·jvm·学习·面试
qq_316837759 分钟前
Element-Plus el-table lazy 自动更新子列表
前端·vue.js·elementui
heartbeat..9 分钟前
Spring 声明式事务:原理、使用及失效场景详解
java·spring·面试·事务
寻星探路10 分钟前
【Python 全栈测开之路】Python 基础语法精讲(三):函数、容器类型与文件处理
java·开发语言·c++·人工智能·python·ai·c#
xiaoxue..11 分钟前
把大模型装进自己电脑:Ollama 本地部署大模型完全指南
javascript·面试·node.js·大模型·ollama
xiaolyuh12311 分钟前
【XXL-JOB】执行器 Netty服务 & Tomcat 进程+资源共用详解
java·tomcat
jasnet_u15 分钟前
SpringCloudAlibaba的web微服务快速搭建
java·springboot·springlcoud
BD_Marathon17 分钟前
启动tomcat报错,80 端口已经被其他程序占用
java·tomcat
计算机毕设指导618 分钟前
基于微信小程序的精致护肤购物系统【源码文末联系】
java·spring boot·微信小程序·小程序·tomcat·maven·intellij-idea