Skip to content

Commit

Permalink
Add command to switch back to separate views
Browse files Browse the repository at this point in the history
  • Loading branch information
thekingq20 committed Nov 28, 2024
1 parent 92b0605 commit 42e396d
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/views/viewCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,8 @@ export class ViewCommands implements Disposable {
'gitlens.views.setResultsCommitsFilterOff',
n => this.setResultsCommitsFilter(n, false),
this,
),
),
registerViewCommand('gitlens.views.switchToSeparateViews', this.switchToSeparateViews, this),
);
}

Expand Down Expand Up @@ -1623,6 +1624,22 @@ export class ViewCommands implements Disposable {

void node.triggerChange(true);
}

@log()
private async switchToSeparateViews() {
await configuration.updateEffective('views.scm.grouped.views', {
commits: false,
branches: false,
remotes: false,
stashes: false,
tags: false,
worktrees: false,
contributors: false,
repositories: false,
searchAndCompare: false,
launchpad: false,
});
}
}

async function copyNode(type: ClipboardType, active: ViewNode | undefined, selection: ViewNode[]): Promise<void> {
Expand Down
16 changes: 16 additions & 0 deletions src/views/views.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ export class Views implements Disposable {
void this.container.storage.store('views:scm:grouped:welcome:dismissed', true);
await updateScmGroupedViewsInConfig(new Set());
}),
registerCommand('gitlens.views.switchToSeparateViews', () => this.switchToSeparateViews()),
];
}

Expand Down Expand Up @@ -841,6 +842,21 @@ export class Views implements Disposable {
return void executeCoreCommand(`gitlens.views.scm.grouped.focus`);
}
}

private async switchToSeparateViews() {
await configuration.updateEffective('views.scm.grouped.views', {
commits: false,
branches: false,
remotes: false,
stashes: false,
tags: false,
worktrees: false,
contributors: false,
repositories: false,
searchAndCompare: false,
launchpad: false,
});
}
}

function getGroupedViews(cfg: Record<GroupableTreeViewTypes, boolean>) {
Expand Down

0 comments on commit 42e396d

Please sign in to comment.