Преглед изворни кода

modify the conditional branch for the code block shortcut

WNomunomu пре 11 месеци
родитељ
комит
128f6d189a
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      packages/editor/src/client/stores/use-editor-shortcuts.ts

+ 1 - 1
packages/editor/src/client/stores/use-editor-shortcuts.ts

@@ -142,7 +142,7 @@ const makeCodeBlockExtension: Extension = EditorView.domEventHandlers({
 
 
     const isModKey = event.ctrlKey || event.metaKey;
     const isModKey = event.ctrlKey || event.metaKey;
 
 
-    if (event.key.toLowerCase() === 'c' && event.shiftKey && event.altKey && isModKey) {
+    if (event.code === 'KeyC' && event.shiftKey && event.altKey && isModKey) {
       event.preventDefault();
       event.preventDefault();
       makeTextCodeBlock(view);
       makeTextCodeBlock(view);
       return true;
       return true;