r94595 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r94594‎ | r94595 | r94596 >
Date:00:10, 16 August 2011
Author:inez
Status:deferred
Tags:
Comment:
Fix getLineIndex method
Modified paths:
  • /trunk/parsers/wikidom/lib/es/es.Flow.js (modified) (history)

Diff [purge]

Index: trunk/parsers/wikidom/lib/es/es.Flow.js
@@ -51,13 +51,12 @@
5252 }
5353
5454 es.Flow.prototype.getLineIndex = function( offset ) {
55 - var i;
56 - for ( i = 0; i < this.lines.length; i++ ) {
 55+ for ( var i = 0; i < this.lines.length; i++ ) {
5756 if ( this.lines[i].range.containsOffset( offset ) ) {
58 - break;
 57+ return i;
5958 }
6059 }
61 - return i;
 60+ return this.lines.length - 1;
6261 };
6362
6463 /**

Status & tagging log