fix(editor): route save shortcut by context

This commit is contained in:
t8y2 committed 2026-05-15 13:10:43 +08:00
1 parent c2da1f866c
commit 72dd4d728b
6 files changed
+45 -11

No files matched your search

+7
View File
@@ -26,6 +26,13 @@ export function isFocusSearchShortcut(event: ShortcutLikeEvent): boolean {
return event.key.toLowerCase() === "f";
}
export function isSaveShortcut(event: ShortcutLikeEvent): boolean {
if (event.isComposing) return false;
if (event.altKey) return false;
if (!event.metaKey && !event.ctrlKey) return false;
return event.key.toLowerCase() === "s";
}
export function isCancelSearchShortcut(event: ShortcutLikeEvent): boolean {
if (event.isComposing) return false;
return event.key === "Escape";