1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-07-16 00:14:34 +02:00

Desktop: Resolves #4759: Fixed editor focus issue when running command from palette (#4812)

This commit is contained in:
Aksh-Konda
2021-04-07 01:51:24 +05:30
committed by GitHub
parent c79c9c4c2f
commit c37c2256c6
6 changed files with 45 additions and 29 deletions

View File

@ -0,0 +1,25 @@
// Editor commands will focus the editor after they're executed
export default function isEditorCommand(commandName: string) {
if (!commandName) return false;
return (commandName.indexOf('editor.') === 0 ||
// These commands are grandfathered in, but in the future
// all editor commands should start with "editor."
// WARNING: Some commands such as textLink are not defined here
// because they are more complex and handle focus manually
commandName === 'textCopy' ||
commandName === 'textCut' ||
commandName === 'textPaste' ||
commandName === 'textSelectAll' ||
commandName === 'textBold' ||
commandName === 'textItalic' ||
commandName === 'textCode' ||
commandName === 'attachFile' ||
commandName === 'textNumberedList' ||
commandName === 'textBulletedList' ||
commandName === 'textCheckbox' ||
commandName === 'textHeading' ||
commandName === 'textHorizontalRule' ||
commandName === 'insertDateTime'
);
}