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

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

目录

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

一、 笙默考试管理系统-MyExamTest----codemirror

二、 笙默考试管理系统-MyExamTest----codemirror

三、 笙默考试管理系统-MyExamTest----codemirror

四、 笙默考试管理系统-MyExamTest----codemirror

五、 笙默考试管理系统-MyExamTest----codemirror

  • 笙默考试管理系统-MyExamTest----codemirror

  this.maybeSpill();

                    }

                    break;

                }

                at -= sz;

            }

        },

        maybeSpill: function() {

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

            var me = this;

            do {

  • 笙默考试管理系统-MyExamTest----codemirror

                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----codemirror

                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) {

  • 笙默考试管理系统-MyExamTest----codemirror

                    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;

            }

        }

    };

  • 笙默考试管理系统-MyExamTest----codemirror

    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;

            }

        }

        return chunk.lines[n];

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

N201871643

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值