From 8c2fb77935a793513e79488ec8532cd083ba2d39 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Thu, 16 Jun 2016 10:50:37 +0200 Subject: [PATCH] add icons for preview and view source --- extensions/markdown/media/ViewSource.svg | 3 +++ .../markdown/media/ViewSource_inverse.svg | 1 + extensions/markdown/package.json | 23 +++++++++++++++++-- extensions/markdown/src/extension.ts | 2 +- 4 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 extensions/markdown/media/ViewSource.svg create mode 100644 extensions/markdown/media/ViewSource_inverse.svg diff --git a/extensions/markdown/media/ViewSource.svg b/extensions/markdown/media/ViewSource.svg new file mode 100644 index 00000000000..85a001dccc2 --- /dev/null +++ b/extensions/markdown/media/ViewSource.svg @@ -0,0 +1,3 @@ + +]> \ No newline at end of file diff --git a/extensions/markdown/media/ViewSource_inverse.svg b/extensions/markdown/media/ViewSource_inverse.svg new file mode 100644 index 00000000000..f6302185aa4 --- /dev/null +++ b/extensions/markdown/media/ViewSource_inverse.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/extensions/markdown/package.json b/extensions/markdown/package.json index b789ae079d6..e40ac15c0f6 100644 --- a/extensions/markdown/package.json +++ b/extensions/markdown/package.json @@ -42,11 +42,30 @@ "commands": [ { "command": "extension.previewMarkdown", - "title": "%markdown.previewMarkdown.title%" + "title": "%markdown.previewMarkdown.title%", + "context": [{ + "where": "editor/primary", + "when": "markdown", + "icon": { + "light": "./media/Preview.svg", + "dark": "./media/Preview_inverse.svg" + } + },{ + "where": "editor/primary", + "when": { "scheme": "markdown" }, + "icon": { + "light": "./media/ViewSource.svg", + "dark": "./media/ViewSource_inverse.svg" + } + }] }, { "command": "extension.previewMarkdownSide", - "title": "%markdown.previewMarkdownSide.title%" + "title": "%markdown.previewMarkdownSide.title%", + "context": { + "where": "editor/secondary", + "when": "markdown" + } } ], "keybindings": [ diff --git a/extensions/markdown/src/extension.ts b/extensions/markdown/src/extension.ts index bbf04e817e4..65b09e9c231 100644 --- a/extensions/markdown/src/extension.ts +++ b/extensions/markdown/src/extension.ts @@ -62,7 +62,7 @@ function isMarkdownFile(document: vscode.TextDocument) { } function getMarkdownUri(document: vscode.TextDocument) { - return document.uri.with({ scheme: 'markdown', query: document.uri.toString() }); + return document.uri.with({ scheme: 'markdown', path: String(document.version), query: document.uri.toString() }); } function openPreview(sideBySide?: boolean): void {