diff --git a/src/vs/editor/common/controller/cursor.ts b/src/vs/editor/common/controller/cursor.ts index 7252ef7edacd8f2d4178f8a69e3f2b879737df04..1426aa9d36d459b9d079879dfc82ba2b44166087 100644 --- a/src/vs/editor/common/controller/cursor.ts +++ b/src/vs/editor/common/controller/cursor.ts @@ -318,11 +318,12 @@ export class Cursor extends EventEmitter { var handled = false; try { + var oldSelections = this.cursors.getSelections(); + var oldViewSelections = this.cursors.getViewSelections(); + // ensure valid state on all cursors this.cursors.ensureValidState(); - var oldSelections = this.cursors.getSelections(); - var oldViewSelections = this.cursors.getViewSelections(); var prevCursorsState = this.cursors.saveState(); var eventSource = source;