mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-10 16:58:55 -05:00
Enable toggle md preview in modals/agents
This commit is contained in:
@@ -263,6 +263,16 @@
|
||||
"when": "editorLangId =~ /^(markdown|prompt|instructions|chatagent|skill)$/ && !notebookEditorFocused && !hasCustomMarkdownPreview",
|
||||
"alt": "markdown.showPreview",
|
||||
"group": "navigation"
|
||||
},
|
||||
{
|
||||
"command": "markdown.reopenAsPreview",
|
||||
"when": "activeEditor == workbench.editors.files.textFileEditor && resourceLangId =~ /^(markdown|prompt|instructions|chatagent|skill)$/ && !notebookEditorFocused && !hasCustomMarkdownPreview",
|
||||
"group": "navigation"
|
||||
},
|
||||
{
|
||||
"command": "markdown.reopenAsSource",
|
||||
"when": "activeCustomEditorId == 'vscode.markdown.preview.editor'",
|
||||
"group": "navigation"
|
||||
}
|
||||
],
|
||||
"explorer/context": [
|
||||
|
||||
@@ -66,9 +66,10 @@ function getCommandsContext(commandArgs: unknown[], editorService: IEditorServic
|
||||
// Get editor context for which the command was triggered
|
||||
let editorContext = getEditorContextFromCommandArgs(commandArgs, isListAction, editorService, editorGroupsService, listService);
|
||||
|
||||
// If the editor context can not be determind use the active editor
|
||||
// If the editor context can not be determined use the active editor
|
||||
if (!editorContext) {
|
||||
const activeGroup = editorGroupsService.activeGroup;
|
||||
const modalEditorPart = editorGroupsService.activeModalEditorPart;
|
||||
const activeGroup = modalEditorPart?.activeGroup ?? editorGroupsService.activeGroup;
|
||||
const activeEditor = activeGroup.activeEditor;
|
||||
editorContext = { groupId: activeGroup.id, editorIndex: activeEditor ? activeGroup.getIndexOfEditor(activeEditor) : undefined };
|
||||
isListAction = false;
|
||||
|
||||
Reference in New Issue
Block a user