Преглед на файлове

:art: fix https://github.com/siyuan-note/siyuan/issues/6339

Vanessa преди 2 години
родител
ревизия
40d95b095b

+ 3 - 1
app/appearance/langs/en_US.json

@@ -1,4 +1,6 @@
 {
+  "expandDown": "Expand Down",
+  "expandUp": "Expand Up",
   "goForward": "Go forward",
   "goBack": "Go back",
   "docNameAndContent": "Doc Name and Content",
@@ -17,7 +19,7 @@
   "defBlockChildren": "Define block and its children",
   "filter": "Filter",
   "headings1": "Headings and Bottom Blocks",
-  "tWithSubtitle":"Transformation with subtitles",
+  "tWithSubtitle": "Transformation with subtitles",
   "clear": "Clear",
   "autoDownloadUpdatePkg": "Automatically download update installation package",
   "autoDownloadUpdatePkgTip": "After enabling, it will automatically check the version update every two hours. If there is an updated version, it will automatically download the installation package and prompt for installation",

+ 2 - 0
app/appearance/langs/es_ES.json

@@ -1,4 +1,6 @@
 {
+  "expandDown": "Expandir hacia abajo",
+  "expandUp": "Expandir hacia arriba",
   "goForward": "Ir hacia adelante",
   "goBack": "Ir hacia atrás",
   "docNameAndContent": "Nombre y contenido del documento",

+ 2 - 0
app/appearance/langs/fr_FR.json

@@ -1,4 +1,6 @@
 {
+  "expandDown": "Développer vers le bas",
+  "expandUp": "Développer vers le haut",
   "goForward": "Suivant",
   "goBack": "Retour",
   "docNameAndContent": "Nom et contenu du document",

+ 2 - 0
app/appearance/langs/zh_CHT.json

@@ -1,4 +1,6 @@
 {
+  "expandDown": "向下擴選",
+  "expandUp": "向上擴選",
   "goForward": "前進",
   "goBack": "後退",
   "docNameAndContent": "文檔名和內容",

+ 2 - 0
app/appearance/langs/zh_CN.json

@@ -1,4 +1,6 @@
 {
+  "expandDown": "向下扩选",
+  "expandUp": "向上扩选",
   "goForward": "前进",
   "goBack": "后退",
   "docNameAndContent": "文档名和内容",

+ 1 - 1
app/src/config/keymap.ts

@@ -276,7 +276,7 @@ export const keymap = {
                     }
 
                     if (["⌘", "⇧", "⌥", "⌃"].includes(keymapStr.substr(keymapStr.length - 1, 1)) ||
-                        ["⌘A", "⌘X", "⌘C", "⌘V", "⌘/", "⌥⇧↑", "⌥⇧↓", "⇧↑", "⇧↓", "⇧→", "⇧←", "⇧⇥", "⇧⌘⇥", "⌃⇥", "⌘⇥", "⌃⌘⇥", "⇧⌘→", "⇧⌘←", "⌘Home", "⌘End", "⇧↩", "↩", "PageUp", "PageDown", "⌫", "⌦"].includes(keymapStr)) {
+                        ["⌘A", "⌘X", "⌘C", "⌘V", "⌘/", "⇧↑", "⇧↓", "⇧→", "⇧←", "⇧⇥", "⇧⌘⇥", "⌃⇥", "⌘⇥", "⌃⌘⇥", "⇧⌘→", "⇧⌘←", "⌘Home", "⌘End", "⇧↩", "↩", "PageUp", "PageDown", "⌫", "⌦"].includes(keymapStr)) {
                         showMessage(tip + "] " + window.siyuan.languages.invalid);
                         return;
                     }

+ 3 - 1
app/src/constants.ts

@@ -105,7 +105,7 @@ export abstract class Constants {
         "222": ["'", '"'],
     };
     // "⌘", "⇧", "⌥", "⌃"
-    // "⌘A", "⌘X", "⌘C", "⌘V", "⌘/", "⌥⇧↑", "⌥⇧↓", "⇧↑", "⇧↓", "⇧→", "⇧←", "⇧⇥", "⇧⌘⇥", "⌃⇥", "⌘⇥", "⌃⌘⇥", "⇧⌘→", "⇧⌘←", "⌘Home", "⌘End", "⇧↩", "↩", "PageUp", "PageDown", "⌫", "⌦", "⌃I", "⌃E", "⌃N", "⌃U" 不可自定义
+    // "⌘A", "⌘X", "⌘C", "⌘V", "⌘/", "⇧↑", "⇧↓", "⇧→", "⇧←", "⇧⇥", "⇧⌘⇥", "⌃⇥", "⌘⇥", "⌃⌘⇥", "⇧⌘→", "⇧⌘←", "⌘Home", "⌘End", "⇧↩", "↩", "PageUp", "PageDown", "⌫", "⌦", "⌃I", "⌃E", "⌃N", "⌃U" 不可自定义
     public static readonly SIYUAN_KEYMAP: IKeymap = {
         general: {
             syncNow: {default: "F9", custom: "F9"},
@@ -137,6 +137,8 @@ export abstract class Constants {
         },
         editor: {
             general: {
+                expandDown: {default: "⌥⇧↓", custom: "⌥⇧↓"},
+                expandUp: {default: "⌥⇧↑", custom: "⌥⇧↑"},
                 copyPlainText: {default: "", custom: ""},
                 copyID: {default: "", custom: ""},
                 netImg2LocalAsset: {default: "", custom: ""},

+ 2 - 2
app/src/protyle/wysiwyg/keydown.ts

@@ -282,7 +282,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
             }
         }
 
-        if (matchHotKey("⌥⇧↑", event)) {
+        if (matchHotKey(window.siyuan.config.keymap.editor.general.expandUp.custom, event)) {
             upSelect({
                 protyle, event, nodeElement, editorElement, range,
                 cb(selectElements) {
@@ -307,7 +307,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
             return;
         }
 
-        if (matchHotKey("⌥⇧↓", event)) {
+        if (matchHotKey(window.siyuan.config.keymap.editor.general.expandDown.custom, event)) {
             downSelect({
                 protyle, event, nodeElement, editorElement, range,
                 cb(selectElements) {