From 474aab0a18968059691ddff3d5ad5bc022805418 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Fri, 4 Nov 2016 19:08:10 +0100 Subject: [PATCH] Always emit events when cursor state changes (even if the previous state is invalid) --- src/vs/editor/common/controller/cursor.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/vs/editor/common/controller/cursor.ts b/src/vs/editor/common/controller/cursor.ts index 7252ef7edac..1426aa9d36d 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; -- GitLab