فهرست منبع

modify the conditional branch for the code block shortcut

WNomunomu 1 سال پیش
والد
کامیت
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;
 
-    if (event.key.toLowerCase() === 'c' && event.shiftKey && event.altKey && isModKey) {
+    if (event.code === 'KeyC' && event.shiftKey && event.altKey && isModKey) {
       event.preventDefault();
       makeTextCodeBlock(view);
       return true;