@@ -194,16 +194,14 @@ function moveActiveEditorToGroup(args: ActiveEditorMoveArguments, control: IEdit
194194}
195195
196196function registerEditorGroupsLayoutCommand ( ) : void {
197- CommandsRegistry . registerCommand ( LAYOUT_EDITOR_GROUPS_COMMAND_ID , applyEditorGroupLayout ) ;
198- }
199-
200- function applyEditorGroupLayout ( accessor : ServicesAccessor , args : EditorGroupLayout ) : void {
201- if ( ! args || typeof args !== 'object' ) {
202- return ;
203- }
197+ CommandsRegistry . registerCommand ( LAYOUT_EDITOR_GROUPS_COMMAND_ID , ( accessor : ServicesAccessor , args : EditorGroupLayout ) => {
198+ if ( ! args || typeof args !== 'object' ) {
199+ return ;
200+ }
204201
205- const editorGroupService = accessor . get ( IEditorGroupsService ) ;
206- editorGroupService . applyLayout ( args ) ;
202+ const editorGroupService = accessor . get ( IEditorGroupsService ) ;
203+ editorGroupService . applyLayout ( args ) ;
204+ } ) ;
207205}
208206
209207export function mergeAllGroups ( editorGroupService : IEditorGroupsService , target = editorGroupService . groups [ 0 ] ) : void {
@@ -262,18 +260,6 @@ function registerDiffEditorCommands(): void {
262260 } ) ;
263261}
264262
265- function getCommandsContext ( resourceOrContext : URI | IEditorCommandsContext , context ?: IEditorCommandsContext ) : IEditorCommandsContext {
266- if ( URI . isUri ( resourceOrContext ) ) {
267- return context ;
268- }
269-
270- if ( typeof resourceOrContext . groupId === 'number' ) {
271- return resourceOrContext ;
272- }
273-
274- return void 0 ;
275- }
276-
277263function registerOpenEditorAtIndexCommands ( ) : void {
278264
279265 // Keybindings to focus a specific index in the tab folder if tabs are enabled
@@ -598,6 +584,18 @@ function registerCloseEditorCommands() {
598584 } ) ;
599585}
600586
587+ function getCommandsContext ( resourceOrContext : URI | IEditorCommandsContext , context ?: IEditorCommandsContext ) : IEditorCommandsContext {
588+ if ( URI . isUri ( resourceOrContext ) ) {
589+ return context ;
590+ }
591+
592+ if ( resourceOrContext && typeof resourceOrContext . groupId === 'number' ) {
593+ return resourceOrContext ;
594+ }
595+
596+ return void 0 ;
597+ }
598+
601599function resolveCommandsContext ( editorGroupService : IEditorGroupsService , context ?: IEditorCommandsContext ) : { group : IEditorGroup , editor : IEditorInput , control : IEditor } {
602600
603601 // Resolve from context
0 commit comments