Index: trunk/extensions/VisualEditor/modules/es/views/es.SurfaceView.js |
— | — | @@ -408,6 +408,21 @@ |
409 | 409 | case 'down': |
410 | 410 | switch ( unit ) { |
411 | 411 | case 'unit': |
| 412 | + var toNode = null; |
| 413 | + this.documentView.model.traverseLeafNodes( |
| 414 | + function( node ) { |
| 415 | + if ( toNode === null) { |
| 416 | + toNode = node; |
| 417 | + } else { |
| 418 | + toNode = node; |
| 419 | + return false; |
| 420 | + } |
| 421 | + }, |
| 422 | + this.documentView.getNodeFromOffset( this.selection.to, false ).getModel(), |
| 423 | + direction === 'up' ? true : false |
| 424 | + ); |
| 425 | + to = this.documentView.model.getOffsetFromNode( toNode, false ) + 1; |
| 426 | + break; |
412 | 427 | case 'char': |
413 | 428 | /* |
414 | 429 | * Looks for the in-document character position that would match up with the |