From c8a9691d6ec32b8e5d4fff0c5490f41689504643 Mon Sep 17 00:00:00 2001 From: Zephrynis Date: Sun, 20 Jul 2025 21:31:31 +0100 Subject: [PATCH] Add cmd+s support --- components/Editor.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/Editor.tsx b/components/Editor.tsx index 982e766..b2597c7 100644 --- a/components/Editor.tsx +++ b/components/Editor.tsx @@ -357,10 +357,10 @@ const Editor = () => { } }, [lang]); - // Add keyboard shortcut for Ctrl+S + // Add keyboard shortcut for Ctrl+S (Windows/Linux) and Cmd+S (macOS) useEffect(() => { const handleKeyDown = (event: KeyboardEvent) => { - if (event.ctrlKey && event.key === 's') { + if ((event.ctrlKey || event.metaKey) && event.key === 's') { event.preventDefault(); if (action === 'edit') { save();