r103479 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103478‎ | r103479 | r103480 >
Date:18:05, 17 November 2011
Author:tparscal
Status:resolved (Comments)
Tags:
Comment:
Fix for issue identified in review of r103377 - this will make it so insertion at a structural offset will work even if the parent isn't the document
Modified paths:
  • /trunk/extensions/VisualEditor/modules/es/es.TransactionProcessor.js (modified) (history)

Diff [purge]

Index: trunk/extensions/VisualEditor/modules/es/es.TransactionProcessor.js
@@ -182,7 +182,8 @@
183183 es.insertIntoArray( this.model.data, this.cursor, op.data );
184184 this.applyAnnotations( this.cursor + op.data.length );
185185 node = this.model.getNodeFromOffset( this.cursor );
186 - index = node.getIndexFromOffset( this.cursor );
 186+ offset = this.model.getOffsetFromNode( node );
 187+ index = node.getIndexFromOffset( this.cursor + offset );
187188 this.rebuildNodes( op.data, null, node, index );
188189 } else {
189190 node = this.model.getNodeFromOffset( this.cursor );

Follow-up revisions

RevisionCommit summaryAuthorDate
r103484Fix for r103479 - had sign backwards! :(tparscal18:16, 17 November 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r103377* Added support for inserting content at a structural offset...tparscal20:39, 16 November 2011

Comments

#Comment by Catrope (talk | contribs)   18:08, 17 November 2011

The plus needs to be a minus. See the else branch of this code.

Status & tagging log