From 18468217958ea069f33ace0a7df62124079a4025 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Wed, 28 Feb 2018 16:54:47 -0800 Subject: [PATCH] Remove extra calls to isMarkdownFile isPreviewOf already handles this --- extensions/markdown/src/features/previewManager.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/extensions/markdown/src/features/previewManager.ts b/extensions/markdown/src/features/previewManager.ts index 57a54f3bc1c..e0854c23096 100644 --- a/extensions/markdown/src/features/previewManager.ts +++ b/extensions/markdown/src/features/previewManager.ts @@ -73,13 +73,13 @@ class MarkdownPreview { }, null, this.disposables); vscode.workspace.onDidChangeTextDocument(event => { - if (isMarkdownFile(event.document) && this.isPreviewOf(event.document.uri)) { + if (this.isPreviewOf(event.document.uri)) { this.refresh(); } }, null, this.disposables); vscode.window.onDidChangeTextEditorVisibleRanges(event => { - if (isMarkdownFile(event.textEditor.document) && this.isPreviewOf(event.textEditor.document.uri)) { + if (this.isPreviewOf(event.textEditor.document.uri)) { const resource = event.textEditor.document.uri; const line = getVisibleLine(event.textEditor); this.updateForView(resource, line); @@ -87,7 +87,7 @@ class MarkdownPreview { }, null, this.disposables); vscode.window.onDidChangeTextEditorSelection(event => { - if (isMarkdownFile(event.textEditor.document) && this.isPreviewOf(event.textEditor.document.uri)) { + if (this.isPreviewOf(event.textEditor.document.uri)) { this.webview.postMessage({ type: 'onDidChangeTextEditorSelection', line: event.selections[0].active.line, @@ -261,7 +261,7 @@ class MarkdownPreview { private onDidScrollPreview(line: number) { for (const editor of vscode.window.visibleTextEditors) { - if (!isMarkdownFile(editor.document) || editor.document.uri.fsPath !== this._resource.fsPath) { + if (!this.isPreviewOf(editor.document.uri)) { continue; }