Desktop: Fixes #6214: Undo and redo on note title did not work in some cases

pull/6246/head
Laurent Cozic 2022-03-03 13:53:11 +00:00
parent 32de63fad3
commit 94dc216add
3 changed files with 18 additions and 6 deletions

View File

@ -572,8 +572,15 @@ function useMenu(props: Props) {
menuItemDic.textPaste,
menuItemDic.textSelectAll,
separator(),
menuItemDic['editor.undo'],
menuItemDic['editor.redo'],
// Using the generic "undo"/"redo" roles mean the menu
// item will work in every text fields, whether it's the
// editor or a regular text field.
{
role: 'undo',
},
{
role: 'redo',
},
separator(),
menuItemDic.textBold,
menuItemDic.textItalic,

View File

@ -93,11 +93,11 @@ const declarations: CommandDeclaration[] = [
},
{
name: 'editor.undo',
label: () => _('Undo'),
label: () => _('Editor: %s', _('Undo')),
},
{
name: 'editor.redo',
label: () => _('Redo'),
label: () => _('Editor: %s', _('Redo')),
},
{
name: 'editor.indentLess',

View File

@ -40,8 +40,13 @@ export default function() {
'toggleVisiblePanes',
'editor.deleteLine',
'editor.duplicateLine',
'editor.undo',
'editor.redo',
// We cannot put the undo/redo commands in the menu because they are
// editor-specific commands. If we put them there it will break the
// undo/redo in regular text fields.
// https://github.com/laurent22/joplin/issues/6214
// 'editor.undo',
// 'editor.redo',
'editor.indentLess',
'editor.indentMore',
'editor.toggleComment',