Index: trunk/extensions/VisualEditor/modules/es/bases/es.DocumentBranchNode.js |
— | — | @@ -173,13 +173,15 @@ |
174 | 174 | return [ { 'node': this.children[i] } ]; |
175 | 175 | } |
176 | 176 | if ( start == left - 1 ) { |
177 | | - // start is between this.children[i-1] and this.children[i], move it to left for convenience |
| 177 | + // start is between this.children[i-1] and this.children[i], move it to left for |
| 178 | + // convenience |
178 | 179 | // We don't need to check for start < end here because we already have start != end and |
179 | 180 | // start <= end |
180 | 181 | start = left; |
181 | 182 | } |
182 | 183 | if ( end == right + 1 ) { |
183 | | - // end is between this.children[i] and this.children[i+1], move it to right for convenience |
| 184 | + // end is between this.children[i] and this.children[i+1], move it to right for |
| 185 | + // convenience |
184 | 186 | // We don't need to check for start < end here because we already have start != end and |
185 | 187 | // start <= end |
186 | 188 | end = right; |
— | — | @@ -191,18 +193,22 @@ |
192 | 194 | if ( startInside && endInside ) { |
193 | 195 | // The range is entirely inside this.children[i] |
194 | 196 | if ( shallow ) { |
195 | | - nodes = [{ 'node': this.children[i], 'range': new es.Range( start - left, end - left ) }]; |
| 197 | + nodes = [ |
| 198 | + { 'node': this.children[i], 'range': new es.Range( start - left, end - left ) } |
| 199 | + ]; |
196 | 200 | } else { |
197 | 201 | // Recurse into this.children[i] |
198 | 202 | nodes = this.children[i].selectNodes( new es.Range( start - left, end - left ) ); |
199 | 203 | } |
200 | | - // Since the start and end are both inside this.children[i], we know for sure that we're done, so |
201 | | - // return |
| 204 | + // Since the start and end are both inside this.children[i], we know for sure that we're |
| 205 | + // done, so return |
202 | 206 | return nodes; |
203 | 207 | } else if ( startInside ) { |
204 | 208 | // The start is inside this.children[i] but the end isn't |
205 | 209 | // Add a range from the start of the range to the end of this.children[i] |
206 | | - nodes.push( { 'node': this.children[i], 'range': new es.Range( start - left, right - left ) } ); |
| 210 | + nodes.push( |
| 211 | + { 'node': this.children[i], 'range': new es.Range( start - left, right - left ) } |
| 212 | + ); |
207 | 213 | } else if ( endInside ) { |
208 | 214 | // The end is inside this.children[i] but the start isn't |
209 | 215 | // Add a range from the start of this.children[i] to the end of the range |
— | — | @@ -217,7 +223,8 @@ |
218 | 224 | } |
219 | 225 | |
220 | 226 | // Move left to the start of this.children[i+1] for the next iteration |
221 | | - // +2 because we need to jump over the offset between this.children[i] and this.children[i+1] |
| 227 | + // We use +2 because we need to jump over the offset between this.children[i] and |
| 228 | + // this.children[i+1] |
222 | 229 | left = right + 2; |
223 | 230 | } |
224 | 231 | |