@@ -1145,6 +1145,7 @@ export class ToggleMaximizeEditorGroupAction extends Action2 {
11451145
11461146 override async run ( accessor : ServicesAccessor , resourceOrContext ?: URI | IEditorCommandsContext , context ?: IEditorCommandsContext ) : Promise < void > {
11471147 const editorGroupsService = accessor . get ( IEditorGroupsService ) ;
1148+
11481149 const { group } = resolveCommandsContext ( editorGroupsService , getCommandsContext ( resourceOrContext , context ) ) ;
11491150 editorGroupsService . toggleMaximizeGroup ( group ) ;
11501151 }
@@ -2503,24 +2504,21 @@ abstract class BaseMoveCopyEditorToNewWindowAction extends Action2 {
25032504 } ) ;
25042505 }
25052506
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 ) {
25082508 const editorGroupService = accessor . get ( IEditorGroupsService ) ;
25092509
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 ( ) ;
25142513
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+ }
25162519
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 ( ) ;
25212521 }
2522-
2523- auxiliaryEditorPart . activeGroup . focus ( ) ;
25242522 }
25252523}
25262524
0 commit comments