fix delete with keyboard and context menu regarding the selection

This commit is contained in:
zadam
2019-06-13 22:55:06 +02:00
parent f1967fd466
commit 943b35fb7d
3 changed files with 14 additions and 8 deletions

View File

@@ -7,7 +7,13 @@ import clipboard from "./clipboard.js";
const keyBindings = {
"del": node => {
treeChangesService.deleteNodes(treeService.getSelectedNodes(true));
let notesToDelete = treeService.getSelectedNodes(true);
if (notesToDelete.length === 0) {
notesToDelete.push(node);
}
treeChangesService.deleteNodes(notesToDelete);
},
"ctrl+up": node => {
const beforeNode = node.getPrevSibling();