feat: option to show markdown preview for super notes (skip e2e) (#2048)

This commit is contained in:
Mo
2022-11-23 11:22:01 -06:00
committed by GitHub
parent 99163d90d2
commit 8579ff39b1
28 changed files with 454 additions and 217 deletions

View File

@@ -165,6 +165,22 @@ export class KeyboardService {
}
}
public triggerCommand(command: KeyboardCommand): void {
for (const observer of this.commandHandlers) {
if (observer.command !== command) {
continue
}
const callback = observer.onKeyDown || observer.onKeyUp
if (callback) {
const exclusive = callback(new KeyboardEvent('command-trigger'))
if (exclusive) {
return
}
}
}
}
registerShortcut(shortcut: KeyboardShortcut): void {
this.commandMap.set(shortcut.command, shortcut)
}