Fixing backspace when at the beginning of the document.

Change-Id: Ib4c463c6a1eb27897a39c96c46617047d8ee4325
This commit is contained in:
Christian Williams 2012-06-20 21:34:11 -07:00
parent 48bba8fcb8
commit 4df69b01de

View file

@ -603,7 +603,7 @@ ve.ce.Surface.prototype.handleDelete = function( backspace ) {
if ( selection.from === selection.to ) { if ( selection.from === selection.to ) {
if ( backspace ) { if ( backspace ) {
sourceOffset = selection.to; sourceOffset = selection.to;
targetOffset = this.model.getDocument().getRelativeContentOffset( sourceOffset, -1 ); targetOffset = this.getNearestCorrectOffset( sourceOffset - 1, -1 );
//this.model.setSelection( new ve.Range( targetOffset, targetOffset ) ); //this.model.setSelection( new ve.Range( targetOffset, targetOffset ) );
} else { } else {
sourceOffset = this.model.getDocument().getRelativeContentOffset( selection.to, 1 ); sourceOffset = this.model.getDocument().getRelativeContentOffset( selection.to, 1 );