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


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

    目录

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

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

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

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

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

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

       // Uses a set of changes plus the current scroll position to

            // determine which DOM updates have to be made, and makes the

            // updates.

            function updateDisplay(changes, suppressCallback) {

                if (!scroller.clientWidth) {

                    showingFrom = showingTo = displayOffset = 0;

                    return;

                }

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

                // Compute the new visible window

                var visible = visibleLines();

                // Bail out if the visible area is already rendered and nothing changed.

                if (changes !== true && changes.length == 0 && visible.from >= showingFrom && visible.to <= showingTo) return;

                var from = Math.max(visible.from - 100, 0), to = Math.min(doc.size, visible.to + 100);

                if (showingFrom < from && from - showingFrom < 20) from = showingFrom;

                if (showingTo > to && showingTo - to < 20) to = Math.min(doc.size, showingTo);

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

                // Create a range of theoretically intact lines, and punch holes

                // in that using the change info.

                var intact = changes === true ? [] :

                    computeIntact([{from: showingFrom, to: showingTo, domStart: 0}], changes);

                // Clip off the parts that won't be visible

                var intactLines = 0;

                for (var i = 0; i < intact.length; ++i) {

                    var range = intact[i];

                    if (range.from < from) {range.domStart += (from - range.from); range.from = from;}

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

                    if (range.to > to) range.to = to;

                    if (range.from >= range.to) intact.splice(i--, 1);

                    else intactLines += range.to - range.from;

                }

                if (intactLines == to - from) return;

                intact.sort(function(a, b) {return a.domStart - b.domStart;});

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

                var th = textHeight(), gutterDisplay = gutter.style.display;

                lineDiv.style.display = gutter.style.display = "none";

                patchDisplay(from, to, intact);

                lineDiv.style.display = "";

                // Position the mover div to align with the lines it's supposed

                // to be showing (which will cover the visible display)

                var different = from != showingFrom || to != showingTo || lastSizeC != scroller.clientHeight + th;

                // This is just a bogus formula that detects when the editor is

                // resized or the font size changes.

                if (different) lastSizeC = scroller.clientHeight + th;

                showingFrom = from; showingTo = to;

                displayOffset = heightAtLine(doc, from);

                mover.style.top = (displayOffset * th) + "px";

                code.style.height = (doc.height * th + 2 * paddingTop()) + "px";

  • 相关阅读:
    为什么 vm._data.date1 vm.date1 都可以访问,并且访问 同一个变量
    linux-进程管理
    stm32h743驱动TFTLCD液晶屏显示图片+汉字(快速上手,只教怎么用,不讲原理!)
    OpenHamony开发笔记一:在HarmonyOS虚拟机上运行openharmony工程
    tutorial/detailed_workflow.ipynb 量化金融Qlib库
    # windows 安装 mysql 显示 no packages found 解决方法
    歌词整理
    【操作系统】第一章:概述
    Vue快速入门二:Vue绑定事件、Vue中的this指向、增加class选择器、动态创建标签
    JS——循环结构经典例题解析与分享
  • 原文地址:https://blog.csdn.net/N201871643/article/details/132678349