diff --git a/src/lib/components/AppLayout.svelte b/src/lib/components/AppLayout.svelte index 8a92e4e..7bdfc25 100644 --- a/src/lib/components/AppLayout.svelte +++ b/src/lib/components/AppLayout.svelte @@ -425,6 +425,13 @@ editor?.addLinkFromToolbar(); } + // Ctrl/Cmd+Shift+Delete: move the open note to the trash. + if (mod && e.shiftKey && code === 'Delete' && $activeNotePath) { + e.preventDefault(); + noteList?.trashActiveNote(); + return; + } + const action = matchAction(e, $keybindings); if (action) { e.preventDefault(); diff --git a/src/lib/components/NoteList.svelte b/src/lib/components/NoteList.svelte index e2c8b83..5dbc2a8 100644 --- a/src/lib/components/NoteList.svelte +++ b/src/lib/components/NoteList.svelte @@ -473,6 +473,13 @@ } } + // Move the currently open note to the trash (keyboard shortcut from the editor). + export async function trashActiveNote() { + if ($viewMode === 'trash' || !$activeNotePath) return; + const note = $notes.find(n => n.path === $activeNotePath); + if (note) await handleDelete(note); + } + async function handleRestore(note: NoteEntry) { contextMenu = null; try {