Skip to content

Commit

Permalink
feat: add ctrl+x
Browse files Browse the repository at this point in the history
  • Loading branch information
SSShooter committed Sep 26, 2024
1 parent f4e5deb commit 6fbba41
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/plugin/contextMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ export default function (mind: MindElixirInstance, option: any) {
mind.unselectNodes()
}
return () => {
// maybe usefull?
// maybe useful?
add_child.onclick = null
add_parent.onclick = null
add_sibling.onclick = null
Expand Down
7 changes: 7 additions & 0 deletions src/plugin/keypress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,13 @@ export default function (mind: MindElixirInstance) {
else if (mind.currentNodes) mind.waitCopy = mind.currentNodes
}
},
x: (e: KeyboardEvent) => {
if (e.metaKey || e.ctrlKey) {
if (mind.currentNode) mind.waitCopy = [mind.currentNode]
else if (mind.currentNodes) mind.waitCopy = mind.currentNodes
handleRemove()
}
},
v: (e: KeyboardEvent) => {
if (!mind.waitCopy || !mind.currentNode) return
if (e.metaKey || e.ctrlKey) {
Expand Down

0 comments on commit 6fbba41

Please sign in to comment.