From eb0ca2626beba3de0d2e6c0220e2c55d34cefc61 Mon Sep 17 00:00:00 2001 From: Pine Wu Date: Tue, 17 Dec 2019 15:16:35 -0800 Subject: [PATCH] Fix #86844 --- .../client/src/mirrorCursor.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/extensions/html-language-features/client/src/mirrorCursor.ts b/extensions/html-language-features/client/src/mirrorCursor.ts index 3c7cca06ff4..5c9ae446087 100644 --- a/extensions/html-language-features/client/src/mirrorCursor.ts +++ b/extensions/html-language-features/client/src/mirrorCursor.ts @@ -54,6 +54,10 @@ export function activateMirrorCursor( return; } + if (event.textEditor.document?.languageId !== 'html' && event.textEditor.document?.languageId !== 'handlebars') { + return; + } + prevCursors = cursors; cursors = event.selections; @@ -131,11 +135,10 @@ export function activateMirrorCursor( workspace.applyEdit(cleanupEdit); } } - } - /** - * Both cursors are selections - */ - else { + } else { + /** + * Both cursors are selections + */ const charBeforeAndAfterAnchorPositionsRoughlyEqual = isCharBeforeAndAfterPositionsRoughlyEqual( event.textEditor.document, event.selections[0].anchor,