Skip to content

Commit 539cfd9

Browse files
committed
整理代码
1 parent 11f5a16 commit 539cfd9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/cvbMarkdownHandler.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,10 @@ export function setupCvbAsMarkdown(context: vscode.ExtensionContext) {
3939

4040
// 监听文件打开事件
4141
const openDocumentListener = vscode.workspace.onDidOpenTextDocument(document => {
42-
if (document.fileName.endsWith('.cvb') && treatCvbAsMarkdown) {
43-
originalLanguages[document.uri.toString()] = document.languageId;
44-
vscode.languages.setTextDocumentLanguage(document, 'markdown');
42+
if (document.fileName.endsWith('.cvb') && treatCvbAsMarkdown) {
43+
if (document.languageId !== 'markdown') {
44+
vscode.languages.setTextDocumentLanguage(document, 'markdown');
45+
}
4546
}
4647
});
4748
context.subscriptions.push(openDocumentListener);

0 commit comments

Comments
 (0)