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

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

目录

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

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

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

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

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

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

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

  function updateLinesNoUndo(from, to, newText, selFrom, selTo) {

            var recomputeMaxLength = false, maxLineLength = maxLine.length;

            if (!options.lineWrapping)

                doc.iter(from.line, to.line, function(line) {

                    if (line.text.length == maxLineLength) {recomputeMaxLength = true; return true;}

                });

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

            if (from.line != to.line || newText.length > 1) gutterDirty = true;

            var nlines = to.line - from.line, firstLine = getLine(from.line), lastLine = getLine(to.line);

            // First adjust the line structure, taking some care to leave highlighting intact.

            if (from.ch == 0 && to.ch == 0 && newText[newText.length - 1] == "") {

                // This is a whole-line replace. Treated specially to make

                // sure line objects move the way they are supposed to.

                var added = [], prevLine = null;

                if (from.line) {

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

                    prevLine = getLine(from.line - 1);

                    prevLine.fixMarkEnds(lastLine);

                } else lastLine.fixMarkStarts();

                for (var i = 0, e = newText.length - 1; i < e; ++i)

                    added.push(Line.inheritMarks(newText[i], prevLine));

                if (nlines) doc.remove(from.line, nlines, callbacks);

                if (added.length) doc.insert(from.line, added);

            } else if (firstLine == lastLine) {

                if (newText.length == 1)

                    firstLine.replace(from.ch, to.ch, newText[0]);

                else {

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

                    lastLine = firstLine.split(to.ch, newText[newText.length-1]);

                    firstLine.replace(from.ch, null, newText[0]);

                    firstLine.fixMarkEnds(lastLine);

                    var added = [];

                    for (var i = 1, e = newText.length - 1; i < e; ++i)

                        added.push(Line.inheritMarks(newText[i], firstLine));

                    added.push(lastLine);

                    doc.insert(from.line + 1, added);

                }

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

            } else if (newText.length == 1) {

                firstLine.replace(from.ch, null, newText[0]);

                lastLine.replace(null, to.ch, "");

                firstLine.append(lastLine);

                doc.remove(from.line + 1, nlines, callbacks);

你可能感兴趣的:(笙默考试管理系统,前端,javascript,开发语言)