shortcut for close all other pages
This commit is contained in:
1 parent
825c4fdb63
commit
6575515305
4 files changed
+11
-5
No files matched your search
@@ -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 {
|
||||
|
||||
@@ -29,6 +29,7 @@ export const Hotkey = {
|
||||
Backspace: Key.Backspace,
|
||||
Build: hotkey("ctrl.b"),
|
||||
CloseEditor: hotkey("ctrl.w"),
|
||||
CloseAllOtherEditors: hotkey("ctrl.shift.w"),
|
||||
Copy: hotkey("ctrl.c"),
|
||||
Cut: hotkey("ctrl.x"),
|
||||
Delete: Key.Delete,
|
||||
|
||||
Reference in new issue
Block a user