MCPcopy
hub / github.com/csev/py4e / updateLines

Function updateLines

tools/pythonauto/static/codemirrorepl/codemirrorepl.js:841–850  ·  view source on GitHub ↗
(from, to, newText, selFrom, selTo)

Source from the content-addressed store, hash-verified

839 // Replace the range from from to to by the strings in newText.
840 // Afterwards, set the selection to selFrom, selTo.
841 function updateLines(from, to, newText, selFrom, selTo) {
842 if (suppressEdits) return;
843 if (history) {
844 var old = [];
845 doc.iter(from.line, to.line + 1, function(line) { old.push(line.text); });
846 history.addChange(from.line, newText.length, old);
847 while (history.done.length > options.undoDepth) history.done.shift();
848 }
849 updateLinesNoUndo(from, to, newText, selFrom, selTo);
850 }
851 function unredoHelper(from, to) {
852 if (!from.length) return;
853 var set = from.pop(), out = [];

Callers 2

setValueFunction · 0.85
replaceRange1Function · 0.85

Calls 2

updateLinesNoUndoFunction · 0.85
shiftMethod · 0.45

Tested by

no test coverage detected