提交 7e72a4d1 编写于 作者: K kieferrm

fix toggle markdown preview/source \w keybinding

上级 5474147b
......@@ -76,7 +76,11 @@ function showPreview(resource?: Uri, sideBySide: boolean = false) {
}
if (!(resource instanceof Uri)) {
// nothing found that could be shown
if (!vscode.window.activeTextEditor) {
// this is most likely toggling the preview
return vscode.commands.executeCommand('markdown.showSource');
}
// nothing found that could be shown or toggled
return;
}
......@@ -107,6 +111,10 @@ function getViewColumn(sideBySide): ViewColumn {
}
function showSource(mdUri: Uri) {
if (!mdUri) {
return vscode.commands.executeCommand('workbench.action.navigateBack');
}
const docUri = Uri.parse(mdUri.query);
for (let editor of vscode.window.visibleTextEditors) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册