Index: trunk/extensions/VisualEditor/modules/es/views/es.SurfaceView.js |
— | — | @@ -571,7 +571,8 @@ |
572 | 572 | * reach the next/previous line |
573 | 573 | */ |
574 | 574 | var position = this.documentView.getRenderedPositionFromOffset( |
575 | | - this.selection.to |
| 575 | + this.selection.to, |
| 576 | + this.cursor.initialBias |
576 | 577 | ); |
577 | 578 | if ( this.cursor.initialLeft === null ) { |
578 | 579 | this.cursor.initialLeft = position.left; |
— | — | @@ -588,7 +589,8 @@ |
589 | 590 | break; |
590 | 591 | } |
591 | 592 | fakePosition = this.documentView.getRenderedPositionFromOffset( |
592 | | - this.documentView.getOffsetFromRenderedPosition( fakePosition ) |
| 593 | + this.documentView.getOffsetFromRenderedPosition( fakePosition ), |
| 594 | + this.cursor.initialBias |
593 | 595 | ); |
594 | 596 | fakePosition.left = this.cursor.initialLeft; |
595 | 597 | } while ( position.top === fakePosition.top ); |
— | — | @@ -598,8 +600,13 @@ |
599 | 601 | break; |
600 | 602 | } |
601 | 603 | |
602 | | - this.cursor.initialBias = direction === 'right' && unit === 'line' ? true : false; |
603 | | - |
| 604 | + this.cursor.initialBias = ( |
| 605 | + ( direction === 'right' && unit === 'line' ) || |
| 606 | + ( direction === 'down' && unit === 'char' ) || |
| 607 | + ( direction === 'up' && unit === 'char' ) ) ? |
| 608 | + true : |
| 609 | + false; |
| 610 | + |
604 | 611 | if ( this.keyboard.keys.shift && this.selection.from !== to) { |
605 | 612 | this.selection.to = to; |
606 | 613 | this.documentView.drawSelection( this.selection ); |