Skip to content

Commit 57ac833

Browse files
authored
Commit action button - do not add separator for an empty command group (microsoft#159439)
1 parent 31acf42 commit 57ac833

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/vs/workbench/contrib/scm/browser/scmViewPane.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2656,13 +2656,16 @@ export class SCMActionButton implements IDisposable {
26562656
if (button.secondaryCommands?.length) {
26572657
const actions: IAction[] = [];
26582658
for (let index = 0; index < button.secondaryCommands.length; index++) {
2659-
for (const command of button.secondaryCommands[index]) {
2659+
const commands = button.secondaryCommands[index];
2660+
for (const command of commands) {
26602661
actions.push(new Action(command.id, command.title, undefined, true, async () => await this.executeCommand(command.id, ...(command.arguments || []))));
26612662
}
2662-
if (index !== button.secondaryCommands.length - 1) {
2663+
if (commands.length) {
26632664
actions.push(new Separator());
26642665
}
26652666
}
2667+
// Remove last separator
2668+
actions.pop();
26662669

26672670
// ButtonWithDropdown
26682671
this.button = new ButtonWithDropdown(this.container, {

0 commit comments

Comments
 (0)