Treat deltas with empty ranges as NOOPs

This commit is contained in:
aldendaniels 2014-01-11 14:45:08 -06:00
commit 35a27fd1ba

View file

@ -569,6 +569,10 @@ var Document = function(textOrLines) {
**/
this.applyDelta = function(delta, doNotValidate) {
// An empty range is a NOOP.
if (delta.range.isEmpty())
return;
// Split large insert deltas. This is necessary because:
// 1. We need to support splicing delta lines into the document via $lines.splice.apply(...)
// 2. fn.apply() doesn't work for a large number of params. The mallest threshold is on safari 0xFFFF.