Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Commit

Permalink
feat: short cut for undo and redo
Browse files Browse the repository at this point in the history
  • Loading branch information
neko-para committed Aug 6, 2023
1 parent d157b38 commit 3aecfbc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
15 changes: 15 additions & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,21 @@ const expands = ref<string[]>(['root.'])
onMounted(async () => {
await loadFS()
window.onkeydown = ev => {
if (ev.ctrlKey && (ev.key === 'z' || ev.key === 'Z')) {
ev.stopPropagation()
ev.preventDefault()
if (ev.shiftKey) {
if (fs.canRedo()) {
fs.redo()
}
} else {
if (fs.canUndo()) {
fs.undo()
}
}
}
}
})
const someBackward = computed(() => {
Expand Down
2 changes: 0 additions & 2 deletions src/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@ export function commitDuplicate(name: string) {
export function commitDelete(from: string, to: string | null) {
const keys = ['target', 'begin', 'end', 'next', 'timeout_next', 'runout_next']

console.log(from)

const [fd, ff, fh] = Util.pathdiv(from)
const th = to ? Util.pathdiv(to)[2] : null

Expand Down

0 comments on commit 3aecfbc

Please sign in to comment.