mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 22:35:41 +00:00
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:
parent
45bf3577b8
commit
6d6914c3bc
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue