Skip to content

Conversation

SeriousBug
Copy link
Contributor

@SeriousBug SeriousBug commented Nov 2, 2021

Adds a flag for the "Open Preview to the Side" button displayed for markdown files. This makes it possible for extensions to hide this button when desired by setting the flag to true. For example, extensions can now use the following line to disable the preview button:

vscode.commands.executeCommand("setContext", "hasCustomMarkdownPreview", true);

Issue: #136388

Regularly:

With the default markdown preview button disabled by an extension:

Adds a flag for the "Open Preview to the Side" button displayed for markdown files. This makes it possible for extensions to hide this button when desired by setting the flag to true. For example, extensions can now use the following line to disable the preview button:

```js
vscode.commands.executeCommand("setContext", "hasCustomMarkdownView", true);
```
@@ -99,7 +99,7 @@
"editor/title": [
{
"command": "markdown.showPreviewToSide",
"when": "editorLangId == markdown && !notebookEditorFocused",
"when": "editorLangId == markdown && !notebookEditorFocused && !hasCustomMarkdownView",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit] Can we call this hasCustomMarkdownPreview instead? That way it's super clear this is about the md preview

Otherwise looks good to me

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated, thanks!

@mjbvz mjbvz added this to the November 2021 milestone Nov 3, 2021
@mjbvz
Copy link
Collaborator

mjbvz commented Nov 3, 2021

To help us track this work, can you also please open an issue that briefly describes the problem this PR fixes

@SeriousBug
Copy link
Contributor Author

To help us track this work, can you also please open an issue that briefly describes the problem this PR fixes

Thanks for the feedback @mjbvz, I updated the keyword used, and created and linked an issue. Please let me know if anything else needs to be done on my end.

@mjbvz mjbvz merged commit 1aa9a71 into microsoft:main Nov 3, 2021
@mjbvz
Copy link
Collaborator

mjbvz commented Nov 3, 2021

Thanks! Will be in the next VS Code 1.63 insiders

@github-actions github-actions bot locked and limited conversation to collaborators Dec 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants