shortcut for close all other pages

This commit is contained in:
codetypes committed 2025-07-03 11:58:02 +08:00
1 parent 825c4fdb63
commit 6575515305
4 files changed
+11 -5

No files matched your search

+2 -2
View File
@@ -1,12 +1,12 @@
{ {
"name": "behavior3editor", "name": "behavior3editor",
"version": "1.8.2", "version": "1.8.3",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "behavior3editor", "name": "behavior3editor",
"version": "1.8.2", "version": "1.8.3",
"hasInstallScript": true, "hasInstallScript": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "behavior3editor", "name": "behavior3editor",
"version": "1.8.2", "version": "1.8.3",
"main": "dist-electron/main/index.js", "main": "dist-electron/main/index.js",
"description": "行为树编辑器", "description": "行为树编辑器",
"author": "zhandouxiaojiji & codetypes", "author": "zhandouxiaojiji & codetypes",
+7 -2
View File
@@ -68,13 +68,18 @@ export const Workspace: FC = () => {
workspace.save(); workspace.save();
}); });
useKeyPress(Hotkey.CloseEditor, null, (event) => { useKeyPress(Hotkey.CloseAllOtherEditors, null, (event) => {
event.preventDefault(); event.preventDefault();
workspace.editors.forEach((editor) => {
if (editor.path !== workspace.editing?.path) {
workspace.close(editor.path);
}
});
}); });
useKeyPress(Hotkey.CloseEditor, null, (event) => { useKeyPress(Hotkey.CloseEditor, null, (event) => {
event.preventDefault();
if (workspace.editing) { if (workspace.editing) {
event.preventDefault();
if (workspace.editing.changed) { if (workspace.editing.changed) {
showSaveDialog(workspace.editing); showSaveDialog(workspace.editing);
} else { } else {
+1
View File
@@ -29,6 +29,7 @@ export const Hotkey = {
Backspace: Key.Backspace, Backspace: Key.Backspace,
Build: hotkey("ctrl.b"), Build: hotkey("ctrl.b"),
CloseEditor: hotkey("ctrl.w"), CloseEditor: hotkey("ctrl.w"),
CloseAllOtherEditors: hotkey("ctrl.shift.w"),
Copy: hotkey("ctrl.c"), Copy: hotkey("ctrl.c"),
Cut: hotkey("ctrl.x"), Cut: hotkey("ctrl.x"),
Delete: Key.Delete, Delete: Key.Delete,