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,