Skip to content

Commit

Permalink
Desktop: Fixes #9855: Allow using editor commands in the command pale…
Browse files Browse the repository at this point in the history
…tte (#9861)
  • Loading branch information
personalizedrefrigerator authored Feb 6, 2024
1 parent e462881 commit 8b9ce9e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, any>, expected: boolean) => {
const condition = enabledCondition('textBold');
const wc = new WhenClause(condition);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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' : '',
Expand Down

0 comments on commit 8b9ce9e

Please sign in to comment.