Index: trunk/extensions/VisualEditor/modules/es/views/es.SurfaceView.js |
— | — | @@ -195,8 +195,14 @@ |
196 | 196 | this.moveCursor( 'down' ); |
197 | 197 | break; |
198 | 198 | case 8: // Backspace |
| 199 | + var transaction = this.documentView.model.prepareRemoval( new es.Range( this.selection.to, this.selection.to - 1 ) ); |
| 200 | + this.documentView.model.commit ( transaction ); |
| 201 | + this.selection.from = this.selection.to -= 1; |
| 202 | + this.showCursor(); |
199 | 203 | break; |
200 | 204 | case 46: // Delete |
| 205 | + var transaction = this.documentView.model.prepareRemoval( new es.Range( this.selection.to, this.selection.to + 1 ) ); |
| 206 | + this.documentView.model.commit ( transaction ); |
201 | 207 | break; |
202 | 208 | default: // Insert content (maybe) |
203 | 209 | if ( this.keyboard.keydownTimeout ) { |
— | — | @@ -217,7 +223,7 @@ |
218 | 224 | if ( val.length > 0 ) { |
219 | 225 | var transaction = this.documentView.model.prepareInsertion( this.selection.to, val.split('') ); |
220 | 226 | this.documentView.model.commit ( transaction ); |
221 | | - this.selection.to += val.length; |
| 227 | + this.selection.from = this.selection.to += val.length; |
222 | 228 | this.showCursor(); |
223 | 229 | } |
224 | 230 | }; |