Fix missing adjustment in TransactionProcessor

I forgot to adjust a range based on this.cursor for this.adjustment .
This indirectly caused Rob to get an exception when trying to wrap
the last node in the document, because the unadjusted range was past the
end of the document.

Change-Id: If9d5b76568fae25ba2c0f405f1c4fcdd8d879e4f
This commit is contained in:
Catrope 2012-06-14 16:35:05 -07:00
parent 45bf3577b8
commit 6d6914c3bc

View file

@ -250,7 +250,10 @@ ve.dm.TransactionProcessor.processors.replace = function( op ) {
opInsert = this.reversed ? operation.remove : operation.insert;
// Update the linear model for this insert
ve.batchSplice( this.document.data, this.cursor, opRemove.length, opInsert );
affectedRanges.push( new ve.Range( this.cursor, this.cursor + opRemove.length ) );
affectedRanges.push( new ve.Range(
this.cursor - this.adjusment,
this.cursor - this.adjusment + opRemove.length
) );
prevCursor = this.cursor;
this.cursor += opInsert.length;
// Paint the removed selection, figure out which nodes were