MCPcopy
hub / github.com/hokein/electron-sample-apps / updateLines

Function updateLines

mini-code-editor/cm/lib/codemirror.js:641–650  ·  view source on GitHub ↗
(from, to, newText, selFrom, selTo)

Source from the content-addressed store, hash-verified

639 // Replace the range from from to to by the strings in newText.
640 // Afterwards, set the selection to selFrom, selTo.
641 function updateLines(from, to, newText, selFrom, selTo) {
642 if (suppressEdits) return;
643 if (history) {
644 var old = [];
645 doc.iter(from.line, to.line + 1, function(line) { old.push(line.text); });
646 history.addChange(from.line, newText.length, old);
647 while (history.done.length > options.undoDepth) history.done.shift();
648 }
649 updateLinesNoUndo(from, to, newText, selFrom, selTo);
650 }
651 function unredoHelper(from, to) {
652 if (!from.length) return;
653 var set = from.pop(), out = [];

Callers 2

setValueFunction · 0.85
replaceRange1Function · 0.85

Calls 1

updateLinesNoUndoFunction · 0.85

Tested by

no test coverage detected