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

Function editEnd

tools/pythonauto/static/codemirrorepl/codemirrorepl.js:3212–3218  ·  view source on GitHub ↗
(from, to)

Source from the content-addressed store, hash-verified

3210 // Used to position the cursor after an undo/redo by finding the
3211 // last edited character.
3212 function editEnd(from, to) {
3213 if (!to) return 0;
3214 if (!from) return to.length;
3215 for (var i = from.length, j = to.length; i >= 0 && j >= 0; --i, --j)
3216 if (from.charAt(i) != to.charAt(j)) break;
3217 return j + 1;
3218 }
3219
3220 function indexOf(collection, elt) {
3221 if (collection.indexOf) return collection.indexOf(elt);

Callers 1

unredoHelperFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected