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();