visual-studio-code - How to detect if an editor is a markdown preview?
问题描述
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?
解决方案
"when": "markdownPreviewFocus"
How did I find this? (With a markdown preview editor open)
Toggle the Help/Developer Tools On, go to its console.
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!
推荐阅读
- sonarqube - 将单个 VSTS 构建中的 .net 代码和 typescript 代码扫描到单个 SonarQube 项目中?
- php - 我想上传多个文件,然后输入它们的标题,而不是想通过单击提交来存储在数据库中
- c# - 如何使用 Selenium、Webdriver、C# 在 Esri 地图上绘制多边形
- webpack - 如何使用 webpack 性能对象在 vue cli 3 中将 js 文件分成块?
- pdf - 如何在受保护的 PDF 文件中显示自定义内容?
- c++ - 运行 C++ 程序时的 VsCode
- r - 错误:当我将带有所有变量的推文转换为数据框时,并非 twList 的所有元素都属于同一类
- oracle - 在 plsql for 循环中使用内连接选择查询失败
- php - 购物车会话问题
- amazon-web-services - 如何在 Docker AWS 日志驱动程序的 docker run 命令中添加 file_fingerprint_lines 选项作为 --log-opt 选项