Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

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

Vanessa40d95b095b86
diff --git a/app/appearance/langs/en_US.json b/app/appearance/langs/en_US.json
index b55fabd20c..428c70fb24 100644
--- a/app/appearance/langs/en_US.json
+++ b/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",
diff --git a/app/appearance/langs/es_ES.json b/app/appearance/langs/es_ES.json
index d51db16480..64d0a25578 100644
--- a/app/appearance/langs/es_ES.json
+++ b/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",
diff --git a/app/appearance/langs/fr_FR.json b/app/appearance/langs/fr_FR.json
index e4641b3223..aa1a2db304 100644
--- a/app/appearance/langs/fr_FR.json
+++ b/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",
diff --git a/app/appearance/langs/zh_CHT.json b/app/appearance/langs/zh_CHT.json
index 61dc8b8297..0997757cf6 100644
--- a/app/appearance/langs/zh_CHT.json
+++ b/app/appearance/langs/zh_CHT.json
@@ -1,4 +1,6 @@
{
+ "expandDown": "向下擴選",
+ "expandUp": "向上擴選",
"goForward": "前進",
"goBack": "後退",
"docNameAndContent": "文檔名和內容",
diff --git a/app/appearance/langs/zh_CN.json b/app/appearance/langs/zh_CN.json
index d1a108a0a3..fc985b7996 100644
--- a/app/appearance/langs/zh_CN.json
+++ b/app/appearance/langs/zh_CN.json
@@ -1,4 +1,6 @@
{
+ "expandDown": "向下扩选",
+ "expandUp": "向上扩选",
"goForward": "前进",
"goBack": "后退",
"docNameAndContent": "文档名和内容",
diff --git a/app/src/config/keymap.ts b/app/src/config/keymap.ts
index e073412fbb..76ad01df31 100644
--- a/app/src/config/keymap.ts
+++ b/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;
}
diff --git a/app/src/constants.ts b/app/src/constants.ts
index 7052d33847..72bbe00c08 100644
--- a/app/src/constants.ts
+++ b/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: ""},
diff --git a/app/src/protyle/wysiwyg/keydown.ts b/app/src/protyle/wysiwyg/keydown.ts
index 9d24426869..238212e98a 100644
--- a/app/src/protyle/wysiwyg/keydown.ts
+++ b/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) {