Skip to content

Commit

Permalink
Use more standard name for markdown preview context key
Browse files Browse the repository at this point in the history
  • Loading branch information
mjbvz committed Feb 28, 2018
1 parent 85d47a7 commit 94ea10f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
12 changes: 6 additions & 6 deletions extensions/markdown/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -155,22 +155,22 @@
},
{
"command": "markdown.showSource",
"when": "markdownPreview",
"when": "markdownPreviewFocus",
"group": "navigation"
},
{
"command": "markdown.refreshPreview",
"when": "markdownPreview",
"when": "markdownPreviewFocus",
"group": "1_markdown"
},
{
"command": "markdown.preview.toggleLock",
"when": "markdownPreview",
"when": "markdownPreviewFocus",
"group": "1_markdown"
},
{
"command": "markdown.showPreviewSecuritySelector",
"when": "markdownPreview",
"when": "markdownPreviewFocus",
"group": "1_markdown"
}
],
Expand Down Expand Up @@ -199,7 +199,7 @@
},
{
"command": "markdown.showSource",
"when": "markdownPreview",
"when": "markdownPreviewFocus",
"group": "navigation"
},
{
Expand All @@ -208,7 +208,7 @@
},
{
"command": "markdown.showPreviewSecuritySelector",
"when": "markdownPreview"
"when": "markdownPreviewFocus"
}
]
},
Expand Down
3 changes: 2 additions & 1 deletion extensions/markdown/src/features/previewContentProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,7 @@ export interface PreviewSettings {
}

export class MarkdownPreviewManager {
private static readonly markdownPreviewActiveContextKey = 'markdownPreviewFocus';

private previews: MarkdownPreview[] = [];
private readonly previewConfigurations = new PreviewConfigManager();
Expand All @@ -497,7 +498,7 @@ export class MarkdownPreviewManager {
private readonly logger: Logger
) {
vscode.window.onDidChangeActiveEditor(editor => {
vscode.commands.executeCommand('setContext', 'markdownPreview',
vscode.commands.executeCommand('setContext', MarkdownPreviewManager.markdownPreviewActiveContextKey,
editor && editor.editorType === 'webview' && editor.uri.scheme === MarkdownPreview.previewScheme);

if (editor && editor.editorType === 'texteditor') {
Expand Down

0 comments on commit 94ea10f

Please sign in to comment.