@@ -1145,6 +1145,7 @@ export class ToggleMaximizeEditorGroupAction extends Action2 {
1145
1145
1146
1146
override async run ( accessor : ServicesAccessor , resourceOrContext ?: URI | IEditorCommandsContext , context ?: IEditorCommandsContext ) : Promise < void > {
1147
1147
const editorGroupsService = accessor . get ( IEditorGroupsService ) ;
1148
+
1148
1149
const { group } = resolveCommandsContext ( editorGroupsService , getCommandsContext ( resourceOrContext , context ) ) ;
1149
1150
editorGroupsService . toggleMaximizeGroup ( group ) ;
1150
1151
}
@@ -2503,24 +2504,21 @@ abstract class BaseMoveCopyEditorToNewWindowAction extends Action2 {
2503
2504
} ) ;
2504
2505
}
2505
2506
2506
- override async run ( accessor : ServicesAccessor ) : Promise < void > {
2507
- const editorService = accessor . get ( IEditorService ) ;
2507
+ override async run ( accessor : ServicesAccessor , resourceOrContext ?: URI | IEditorCommandsContext , context ?: IEditorCommandsContext ) {
2508
2508
const editorGroupService = accessor . get ( IEditorGroupsService ) ;
2509
2509
2510
- const activeEditorPane = editorService . activeEditorPane ;
2511
- if ( ! activeEditorPane ) {
2512
- return ;
2513
- }
2510
+ const { group, editor } = resolveCommandsContext ( editorGroupService , getCommandsContext ( resourceOrContext , context ) ) ;
2511
+ if ( group && editor ) {
2512
+ const auxiliaryEditorPart = await editorGroupService . createAuxiliaryEditorPart ( ) ;
2514
2513
2515
- const auxiliaryEditorPart = await editorGroupService . createAuxiliaryEditorPart ( ) ;
2514
+ if ( this . move ) {
2515
+ group . moveEditor ( editor , auxiliaryEditorPart . activeGroup ) ;
2516
+ } else {
2517
+ group . copyEditor ( editor , auxiliaryEditorPart . activeGroup ) ;
2518
+ }
2516
2519
2517
- if ( this . move ) {
2518
- activeEditorPane . group . moveEditor ( activeEditorPane . input , auxiliaryEditorPart . activeGroup ) ;
2519
- } else {
2520
- activeEditorPane . group . copyEditor ( activeEditorPane . input , auxiliaryEditorPart . activeGroup ) ;
2520
+ auxiliaryEditorPart . activeGroup . focus ( ) ;
2521
2521
}
2522
-
2523
- auxiliaryEditorPart . activeGroup . focus ( ) ;
2524
2522
}
2525
2523
}
2526
2524
0 commit comments