mirror of
https://github.com/zadam/trilium.git
synced 2024-09-20 15:45:58 +08:00
add keyboard shortcut for duplicate subtree, #1451
This commit is contained in:
parent
928ed7a034
commit
7d8277699c
|
@ -184,6 +184,12 @@ const DEFAULT_KEYBOARD_ACTIONS = [
|
|||
description: "Add note above to the selection",
|
||||
scope: "note-tree"
|
||||
},
|
||||
{
|
||||
actionName: "duplicateSubtree",
|
||||
defaultShortcuts: [],
|
||||
description: "Duplicate subtree",
|
||||
scope: "note-tree"
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
|
|
|
@ -739,7 +739,10 @@ function duplicateSubtree(origNoteId, newParentNoteId) {
|
|||
|
||||
const res = duplicateSubtreeInner(origNote, origBranch, newParentNoteId, noteIdMapping);
|
||||
|
||||
res.note.title += " (dup)";
|
||||
if (!res.note.title.endsWith('(dup)')) {
|
||||
res.note.title += " (dup)";
|
||||
}
|
||||
|
||||
res.note.save();
|
||||
|
||||
return res;
|
||||
|
|
Loading…
Reference in a new issue