Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/locales/de-DE/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@
"cut": "Ausschneiden",
"copy": "Kopieren",
"paste": "Einfügen",
"format": "Formatieren",
"exclude_on": "Wiederherstellen auf $0 zur Ausführung",
"exclude_off": "Ausschließen auf $0 zur Ausführung",
"user_config": "Benutzerkonfiguration",
Expand Down Expand Up @@ -608,4 +609,4 @@
"show_script_list": "Skriptliste anzeigen",
"hide_script_list": "Skriptliste ausblenden"
}
}
}
3 changes: 2 additions & 1 deletion src/locales/en-US/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@
"cut": "Cut",
"copy": "Copy",
"paste": "Paste",
"format": "Format",
"exclude_on": "Reinstate $0's execution",
"exclude_off": "Exclude $0's exeuction",
"user_config": "User Config",
Expand Down Expand Up @@ -608,4 +609,4 @@
"show_script_list": "Show Script List",
"hide_script_list": "Hide Script List"
}
}
}
3 changes: 2 additions & 1 deletion src/locales/ja-JP/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@
"cut": "切り取り",
"copy": "コピー",
"paste": "貼り付け",
"format": "フォーマット",
"exclude_on": "$0の実行を復元",
"exclude_off": "$0の実行を除外",
"user_config": "ユーザー設定",
Expand Down Expand Up @@ -608,4 +609,4 @@
"show_script_list": "スクリプトリストを表示",
"hide_script_list": "スクリプトリストを非表示"
}
}
}
3 changes: 2 additions & 1 deletion src/locales/ru-RU/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@
"cut": "Вырезать",
"copy": "Копировать",
"paste": "Вставить",
"format": "Форматировать",
"exclude_on": "Восстановить в $0 выполнении",
"exclude_off": "Исключить в $0 выполнении",
"user_config": "Конфигурация пользователя",
Expand Down Expand Up @@ -608,4 +609,4 @@
"show_script_list": "Показать список скриптов",
"hide_script_list": "Скрыть список скриптов"
}
}
}
3 changes: 2 additions & 1 deletion src/locales/vi-VN/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@
"cut": "Cắt",
"copy": "Sao chép",
"paste": "Dán",
"format": "Định dạng",
"exclude_on": "Cho phép chạy lại $0",
"exclude_off": "Loại trừ chạy $0",
"user_config": "Cấu hình người dùng",
Expand Down Expand Up @@ -608,4 +609,4 @@
"show_script_list": "Hiển thị danh sách script",
"hide_script_list": "Ẩn danh sách script"
}
}
}
3 changes: 2 additions & 1 deletion src/locales/zh-CN/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@
"cut": "剪切",
"copy": "复制",
"paste": "粘贴",
"format": "格式化",
"exclude_on": "恢复在 $0 上执行",
"exclude_off": "排除在 $0 上执行",
"user_config": "用户配置",
Expand Down Expand Up @@ -608,4 +609,4 @@
"show_script_list": "显示脚本列表",
"hide_script_list": "隐藏脚本列表"
}
}
}
3 changes: 2 additions & 1 deletion src/locales/zh-TW/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@
"cut": "剪下",
"copy": "複製",
"paste": "貼上",
"format": "格式化",
"exclude_on": "恢復 $0 的執行",
"exclude_off": "排除 $0 的執行",
"user_config": "使用者設定",
Expand Down Expand Up @@ -608,4 +609,4 @@
"show_script_list": "顯示腳本列表",
"hide_script_list": "隱藏腳本列表"
}
}
}
15 changes: 14 additions & 1 deletion src/pages/options/routes/script/ScriptEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const Editor: React.FC<{
);
});
disposables.push(
node.editor.onKeyUp(() => {
node.editor.onDidChangeModelContent(() => {
onChangeRef.current(node.editor.getValue() || "");
})
);
Expand Down Expand Up @@ -590,6 +590,19 @@ function ScriptEditor() {
e.trigger("menu", "editor.action.selectAll", null);
},
},
{ divider: true },
{
id: "format",
title: t("format"),
hotKey: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyF,
hotKeyString: "Ctrl+Shift+F",
action(_script, e) {
const selection = e.getSelection();
const actionId =
selection && !selection.isEmpty() ? "editor.action.formatSelection" : "editor.action.formatDocument";
e.getAction(actionId)?.run();
},
},
],
},
{
Expand Down
Loading