Index: trunk/parsers/wikidom/lib/hype/views/es.ContentView.js |
— | — | @@ -257,6 +257,8 @@ |
258 | 258 | /** |
259 | 259 | * Gets the index of the rendered line a given offset is within. |
260 | 260 | * |
| 261 | + * Offsets that are out of range will always return the index of the last line. |
| 262 | + * |
261 | 263 | * @method |
262 | 264 | * @param {Integer} offset Offset to get line for |
263 | 265 | * @returns {Integer} Index of rendered lin offset is within |
— | — | @@ -273,9 +275,11 @@ |
274 | 276 | /** |
275 | 277 | * Gets the range of the rendered line a given offset is within. |
276 | 278 | * |
| 279 | + * Offsets that are out of range will always return the range of the last line. |
| 280 | + * |
277 | 281 | * @method |
278 | 282 | * @param {Integer} offset Offset to get line for |
279 | | - * @returns {Range} |
| 283 | + * @returns {es.Range} Range of line offset is within |
280 | 284 | */ |
281 | 285 | es.ContentView.prototype.getRenderedLineRange = function( offset ) { |
282 | 286 | for ( var i = 0; i < this.lines.length; i++ ) { |
— | — | @@ -283,7 +287,7 @@ |
284 | 288 | return this.lines[i].range; |
285 | 289 | } |
286 | 290 | } |
287 | | - return null; |
| 291 | + return this.lines[this.lines.length - 1].range; |
288 | 292 | }; |
289 | 293 | |
290 | 294 | /** |