From 3c161fd2b1c31757f571c7f7ff02b57a5297eb14 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Wed, 24 May 2023 16:30:06 -0700 Subject: [PATCH] Add better label when adding video/video to md (#183379) --- .../src/languageFeatures/copyFiles/shared.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/extensions/markdown-language-features/src/languageFeatures/copyFiles/shared.ts b/extensions/markdown-language-features/src/languageFeatures/copyFiles/shared.ts index 0b108e0b9cf..c0ecbe9a850 100644 --- a/extensions/markdown-language-features/src/languageFeatures/copyFiles/shared.ts +++ b/extensions/markdown-language-features/src/languageFeatures/copyFiles/shared.ts @@ -106,6 +106,7 @@ export function createUriListSnippet( let insertedLinkCount = 0; let insertedImageCount = 0; + let insertedAudioVideoCount = 0; uris.forEach((uri, i) => { const mdPath = getMdPath(dir, uri); @@ -116,12 +117,12 @@ export function createUriListSnippet( const insertAsAudio = mediaFileExtensions.get(ext) === MediaKind.Audio; if (insertAsVideo) { - insertedImageCount++; + insertedAudioVideoCount++; snippet.appendText(`'); } else if (insertAsAudio) { - insertedImageCount++; + insertedAudioVideoCount++; snippet.appendText(`'); @@ -147,7 +148,13 @@ export function createUriListSnippet( }); let label: string; - if (insertedImageCount > 0 && insertedLinkCount > 0) { + if (insertedAudioVideoCount > 0) { + if (insertedLinkCount > 0) { + label = vscode.l10n.t('Insert Markdown Media and Links'); + } else { + label = vscode.l10n.t('Insert Markdown Media'); + } + } else if (insertedImageCount > 0 && insertedLinkCount > 0) { label = vscode.l10n.t('Insert Markdown Images and Links'); } else if (insertedImageCount > 0) { label = insertedImageCount > 1