Skip to content

Commit

Permalink
Fix the issue with commands not available in the command pallette
Browse files Browse the repository at this point in the history
Ensure that commands for dirty diff navigation are always available.
This is consistent with behavior in VS Code, and also with other
similar commands (such as `Next Problem/Previous Problem`) in Theia.
  • Loading branch information
pisv committed Feb 14, 2024
1 parent abc278f commit 0c96afe
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions packages/scm/src/browser/scm-contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,24 +194,19 @@ export class ScmContribution extends AbstractViewContribution<ScmWidget> impleme
isEnabled: () => !!this.scmFocus.get() && !!this.acceptInputCommand()
});
commandRegistry.registerCommand(SCM_COMMANDS.GOTO_NEXT_CHANGE, {
execute: () => this.dirtyDiffNavigator.gotoNextChange(),
isEnabled: () => this.dirtyDiffNavigator.canNavigate()
execute: () => this.dirtyDiffNavigator.gotoNextChange()
});
commandRegistry.registerCommand(SCM_COMMANDS.GOTO_PREVIOUS_CHANGE, {
execute: () => this.dirtyDiffNavigator.gotoPreviousChange(),
isEnabled: () => this.dirtyDiffNavigator.canNavigate()
execute: () => this.dirtyDiffNavigator.gotoPreviousChange()
});
commandRegistry.registerCommand(SCM_COMMANDS.SHOW_NEXT_CHANGE, {
execute: () => this.dirtyDiffNavigator.showNextChange(),
isEnabled: () => this.dirtyDiffNavigator.canShowChange()
execute: () => this.dirtyDiffNavigator.showNextChange()
});
commandRegistry.registerCommand(SCM_COMMANDS.SHOW_PREVIOUS_CHANGE, {
execute: () => this.dirtyDiffNavigator.showPreviousChange(),
isEnabled: () => this.dirtyDiffNavigator.canShowChange()
execute: () => this.dirtyDiffNavigator.showPreviousChange()
});
commandRegistry.registerCommand(SCM_COMMANDS.CLOSE_CHANGE_PEEK_VIEW, {
execute: () => this.dirtyDiffNavigator.closeChangePeekView(),
isEnabled: () => this.dirtyDiffNavigator.isShowingChange()
execute: () => this.dirtyDiffNavigator.closeChangePeekView()
});
}

Expand Down

0 comments on commit 0c96afe

Please sign in to comment.