0

Command markdown.showSource shows the source code of a markdown preview, how to write the When condition so that markdown.showSource only triggers when the active editor is indeed a markdown preview?

4

1 回答 1

0

"when": "markdownPreviewFocus"

How did I find this? (With a markdown preview editor open)

  1. Toggle the Help/Developer Tools On, go to its console.

  2. Start the command Developer: Inspect Context Keys

I just clicked anywhere in vscode. In the developer tools console, you will get a long list of active context keys. I searched for preview and there were a few but this one looked really promising and it worked!

于 2021-08-20T23:49:32.867 回答