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

+7 -2
View File
@@ -68,13 +68,18 @@ export const Workspace: FC = () => {
workspace.save();
});
useKeyPress(Hotkey.CloseEditor, null, (event) => {
useKeyPress(Hotkey.CloseAllOtherEditors, null, (event) => {
event.preventDefault();
workspace.editors.forEach((editor) => {
if (editor.path !== workspace.editing?.path) {
workspace.close(editor.path);
}
});
});
useKeyPress(Hotkey.CloseEditor, null, (event) => {
event.preventDefault();
if (workspace.editing) {
event.preventDefault();
if (workspace.editing.changed) {
showSaveDialog(workspace.editing);
} else {