diff --git a/packages/app-desktop/gui/NoteEditor/editorCommandDeclarations.test.ts b/packages/app-desktop/gui/NoteEditor/editorCommandDeclarations.test.ts index fce63e781..4b7f1410f 100644 --- a/packages/app-desktop/gui/NoteEditor/editorCommandDeclarations.test.ts +++ b/packages/app-desktop/gui/NoteEditor/editorCommandDeclarations.test.ts @@ -54,6 +54,16 @@ describe('editorCommandDeclarations', () => { }, true, ], + [ + // In the Markdown editor, and the command palette is visible + { + markdownEditorPaneVisible: true, + richTextEditorVisible: false, + gotoAnythingVisible: true, + modalDialogVisible: true, + }, + true, + ], ])('should create the enabledCondition', (context: Record, expected: boolean) => { const condition = enabledCondition('textBold'); const wc = new WhenClause(condition); diff --git a/packages/app-desktop/gui/NoteEditor/editorCommandDeclarations.ts b/packages/app-desktop/gui/NoteEditor/editorCommandDeclarations.ts index 89e29d1dd..b46c60d29 100644 --- a/packages/app-desktop/gui/NoteEditor/editorCommandDeclarations.ts +++ b/packages/app-desktop/gui/NoteEditor/editorCommandDeclarations.ts @@ -11,8 +11,9 @@ export const enabledCondition = (commandName: string) => { const noteMustBeMarkdown = !workWithHtmlNotes.includes(commandName); const output = [ - '!modalDialogVisible', - '!gotoAnythingVisible', + // gotoAnythingVisible: Enable if the command palette (which is a modal dialog) is visible + '(!modalDialogVisible || gotoAnythingVisible)', + markdownEditorOnly ? 'markdownEditorPaneVisible' : '(markdownEditorPaneVisible || richTextEditorVisible)', 'oneNoteSelected', noteMustBeMarkdown ? 'noteIsMarkdown' : '',