@@ -13,7 +13,7 @@ import { IWorkbenchLayoutService, Parts } from 'vs/workbench/services/layout/bro
13
13
import { GoFilter , IHistoryService } from 'vs/workbench/services/history/common/history' ;
14
14
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding' ;
15
15
import { ICommandService } from 'vs/platform/commands/common/commands' ;
16
- import { CLOSE_EDITOR_COMMAND_ID , MOVE_ACTIVE_EDITOR_COMMAND_ID , ActiveEditorMoveCopyArguments , SPLIT_EDITOR_LEFT , SPLIT_EDITOR_RIGHT , SPLIT_EDITOR_UP , SPLIT_EDITOR_DOWN , splitEditor , LAYOUT_EDITOR_GROUPS_COMMAND_ID , UNPIN_EDITOR_COMMAND_ID , COPY_ACTIVE_EDITOR_COMMAND_ID , SPLIT_EDITOR , UNMAXIMIZE_EDITOR_GROUP , MAXIMIZE_EDITOR_GROUP , resolveCommandsContext , getCommandsContext } from 'vs/workbench/browser/parts/editor/editorCommands' ;
16
+ import { CLOSE_EDITOR_COMMAND_ID , MOVE_ACTIVE_EDITOR_COMMAND_ID , ActiveEditorMoveCopyArguments , SPLIT_EDITOR_LEFT , SPLIT_EDITOR_RIGHT , SPLIT_EDITOR_UP , SPLIT_EDITOR_DOWN , splitEditor , LAYOUT_EDITOR_GROUPS_COMMAND_ID , UNPIN_EDITOR_COMMAND_ID , COPY_ACTIVE_EDITOR_COMMAND_ID , SPLIT_EDITOR , UNMAXIMIZE_EDITOR_GROUP , MAXIMIZE_EDITOR_GROUP , resolveCommandsContext , getCommandsContext , TOGGLE_MAXIMIZE_EDITOR_GROUP } from 'vs/workbench/browser/parts/editor/editorCommands' ;
17
17
import { IEditorGroupsService , IEditorGroup , GroupsArrangement , GroupLocation , GroupDirection , preferredSideBySideGroupDirection , IFindGroupScope , GroupOrientation , EditorGroupLayout , GroupsOrder } from 'vs/workbench/services/editor/common/editorGroupsService' ;
18
18
import { IEditorService } from 'vs/workbench/services/editor/common/editorService' ;
19
19
import { IConfigurationService } from 'vs/platform/configuration/common/configuration' ;
@@ -1070,13 +1070,8 @@ export class MaximizeGroupAction extends Action2 {
1070
1070
super ( {
1071
1071
id : MAXIMIZE_EDITOR_GROUP ,
1072
1072
title : { value : localize ( 'maximizeEditor' , "Maximize Editor Group" ) , original : 'Maximize Editor Group' } ,
1073
- f1 : true ,
1074
1073
category : Categories . View ,
1075
- precondition : ContextKeyExpr . and ( MaximizedEditorGroupContext . negate ( ) , MultipleEditorGroupsContext ) ,
1076
- keybinding : {
1077
- weight : KeybindingWeight . WorkbenchContrib ,
1078
- primary : KeyChord ( KeyMod . CtrlCmd | KeyCode . KeyK , KeyMod . CtrlCmd | KeyCode . KeyM ) ,
1079
- }
1074
+ precondition : ContextKeyExpr . and ( MaximizedEditorGroupContext . negate ( ) , MultipleEditorGroupsContext )
1080
1075
} ) ;
1081
1076
}
1082
1077
@@ -1118,13 +1113,8 @@ export class UnmaximizeEditorGroupAction extends Action2 {
1118
1113
super ( {
1119
1114
id : UNMAXIMIZE_EDITOR_GROUP ,
1120
1115
title : { value : localize ( 'UnmaximizeEditorGroup' , "Unmaximize Editor Group" ) , original : 'Unmaximize Editor Group' } ,
1121
- f1 : true ,
1122
1116
category : Categories . View ,
1123
1117
precondition : MaximizedEditorGroupContext ,
1124
- keybinding : {
1125
- weight : KeybindingWeight . WorkbenchContrib ,
1126
- primary : KeyChord ( KeyMod . CtrlCmd | KeyCode . KeyK , KeyMod . CtrlCmd | KeyCode . KeyM ) ,
1127
- } ,
1128
1118
menu : [ {
1129
1119
id : MenuId . EditorTitle ,
1130
1120
order : - 10000 , // towards the front
@@ -1148,6 +1138,28 @@ export class UnmaximizeEditorGroupAction extends Action2 {
1148
1138
}
1149
1139
}
1150
1140
1141
+ export class ToggleMaximizeEditorGroupAction extends Action2 {
1142
+
1143
+ constructor ( ) {
1144
+ super ( {
1145
+ id : TOGGLE_MAXIMIZE_EDITOR_GROUP ,
1146
+ title : { value : localize ( 'toggleMaximizeEditorGroup' , "Toggle Maximize Editor Group" ) , original : 'Toggle Maximize Editor Group' } ,
1147
+ f1 : true ,
1148
+ category : Categories . View ,
1149
+ precondition : ContextKeyExpr . or ( MultipleEditorGroupsContext , MaximizedEditorGroupContext ) ,
1150
+ keybinding : {
1151
+ weight : KeybindingWeight . WorkbenchContrib ,
1152
+ primary : KeyChord ( KeyMod . CtrlCmd | KeyCode . KeyK , KeyMod . CtrlCmd | KeyCode . KeyM ) ,
1153
+ }
1154
+ } ) ;
1155
+ }
1156
+
1157
+ override async run ( accessor : ServicesAccessor ) : Promise < void > {
1158
+ const editorGroupService = accessor . get ( IEditorGroupsService ) ;
1159
+ editorGroupService . toggleMaximizeGroup ( ) ;
1160
+ }
1161
+ }
1162
+
1151
1163
abstract class AbstractNavigateEditorAction extends Action2 {
1152
1164
1153
1165
override async run ( accessor : ServicesAccessor ) : Promise < void > {
0 commit comments