Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix preview command key bindings #435

Closed
wants to merge 1 commit into from
Closed

Fix preview command key bindings #435

wants to merge 1 commit into from

Conversation

EFanZh
Copy link

@EFanZh EFanZh commented May 4, 2019

Preview commands should only be handled in Markdown documents.

Preview commands should only be handled in Markdown documents.
@yzhang-gh
Copy link
Owner

Thanks for your contribution.

However, things are a bit more complex. These keybindings are designed to "toggle" preview (open or close). When the active tab is the Markdown preview, we cannot require editorLangId == markdown.

@EFanZh
Copy link
Author

EFanZh commented May 4, 2019

How about using view == 'markdown.preview' (See here)?

The problem is that if I press Ctrl + Shift + V immediately after opening VS Code, the editor reports the following error:

command 'markdown.extension.togglePreview' not found

I think this is because the extension hasn’t been activated.

@yzhang-gh
Copy link
Owner

yzhang-gh commented May 4, 2019

Thanks for the information.

It seems that markdown.preview is not a context key.
There are also many undocumented context keys, which are usually set by
vscode.commands.executeCommand('setContext', key, value);

These keys can be found in the vscode source code. I tried to find but nothing. I am not sure whether we have a proper context key now.


If we still cannot find a good solution, as a workaround, you can delete the conflict keybinding (open keybinding page, search for that, right-click and delete).

@yzhang-gh yzhang-gh closed this May 24, 2020
@EFanZh EFanZh deleted the patch-1 branch May 24, 2020 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants