From baf4e8d3c23fd68a39d48454fc80412734f596c7 Mon Sep 17 00:00:00 2001 From: Elson Wei Date: Mon, 23 Aug 2021 18:49:51 +0800 Subject: [PATCH] Disable shortcuts when the active text editor is undefined --- extension.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/extension.js b/extension.js index 503c907..f38a78b 100644 --- a/extension.js +++ b/extension.js @@ -41,9 +41,7 @@ function activate(context) { vscode.window.onDidChangeActiveTextEditor( editor => { activeEditor = editor; - if (activeEditor) { - toggleMarkdownShortcuts(activeEditor.document.languageId); - } + toggleMarkdownShortcuts(activeEditor?.document.languageId); }, null, context.subscriptions