From f46fdb9fb09e83e7f3b3f5e33ffcca169b4df88c Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Wed, 7 Sep 2022 10:03:25 +0200 Subject: [PATCH] Preview tab title --- CHANGELOG.md | 1 + src/commands/Preview.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 81492f48..3cdc67e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ ### ⚡️ Optimizations - Internal post message optimizations to the webviews +- Preview tab now shows the title of the page/content if present ### 🐞 Fixes diff --git a/src/commands/Preview.ts b/src/commands/Preview.ts index 9a077795..eb3b4d84 100644 --- a/src/commands/Preview.ts +++ b/src/commands/Preview.ts @@ -93,7 +93,7 @@ export class Preview { // Create the preview webview const webView = window.createWebviewPanel( 'frontMatterPreview', - 'FrontMatter Preview', + article?.data?.title ? `Preview: ${article?.data?.title}` : 'FrontMatter Preview', { viewColumn: ViewColumn.Beside, preserveFocus: true