Skip to content

Commit

Permalink
open-editors: fix toolbar enablement and visibility (#11634)
Browse files Browse the repository at this point in the history
* open-editors: fix toolbar

The commit fixes issues with the toolbar for `open editors ` not being enabled, or visible and aligns the behavior closer to vscode. 

Signed-off-by: vince-fugnitto <vincent.fugnitto@ericsson.com>
  • Loading branch information
vince-fugnitto authored Sep 6, 2022
1 parent 8162bfa commit af11fa0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/navigator/src/browser/navigator-contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -358,13 +358,13 @@ export class FileNavigatorContribution extends AbstractViewContribution<FileNavi
});
registry.registerCommand(OpenEditorsCommands.CLOSE_ALL_TABS_FROM_TOOLBAR, {
execute: widget => this.withOpenEditorsWidget(widget, () => this.shell.closeMany(this.editorWidgets)),
isEnabled: widget => this.withOpenEditorsWidget(widget, () => !!this.editorWidgets.length),
isVisible: widget => this.withOpenEditorsWidget(widget, () => !!this.editorWidgets.length)
isEnabled: widget => this.withOpenEditorsWidget(widget, () => true),
isVisible: widget => this.withOpenEditorsWidget(widget, () => true)
});
registry.registerCommand(OpenEditorsCommands.SAVE_ALL_TABS_FROM_TOOLBAR, {
execute: widget => this.withOpenEditorsWidget(widget, () => registry.executeCommand(CommonCommands.SAVE_ALL.id)),
isEnabled: widget => this.withOpenEditorsWidget(widget, () => !!this.editorWidgets.length),
isVisible: widget => this.withOpenEditorsWidget(widget, () => !!this.editorWidgets.length)
isEnabled: widget => this.withOpenEditorsWidget(widget, () => true),
isVisible: widget => this.withOpenEditorsWidget(widget, () => true)
});

const filterEditorWidgets = (title: Title<Widget>) => {
Expand Down

0 comments on commit af11fa0

Please sign in to comment.