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

Function editEnd

mini-code-editor/cm/lib/codemirror.js:3012–3018  ·  view source on GitHub ↗
(from, to)

Source from the content-addressed store, hash-verified

3010 // Used to position the cursor after an undo/redo by finding the
3011 // last edited character.
3012 function editEnd(from, to) {
3013 if (!to) return 0;
3014 if (!from) return to.length;
3015 for (var i = from.length, j = to.length; i >= 0 && j >= 0; --i, --j)
3016 if (from.charAt(i) != to.charAt(j)) break;
3017 return j + 1;
3018 }
3019
3020 function indexOf(collection, elt) {
3021 if (collection.indexOf) return collection.indexOf(elt);

Callers 1

unredoHelperFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected