@@ -30,15 +30,15 @@ export class ScmGroupedView implements Disposable {
3030
3131 executeCommand ( `gitlens.views.${ this . _view . type } .refresh` as Commands ) ;
3232 } ) ,
33- registerCommand ( 'gitlens.views.scm.grouped.branches' , ( ) => this . setView ( 'branches' ) ) ,
34- registerCommand ( 'gitlens.views.scm.grouped.commits' , ( ) => this . setView ( 'commits' ) ) ,
35- registerCommand ( 'gitlens.views.scm.grouped.contributors' , ( ) => this . setView ( 'contributors' ) ) ,
36- registerCommand ( 'gitlens.views.scm.grouped.remotes' , ( ) => this . setView ( 'remotes' ) ) ,
37- registerCommand ( 'gitlens.views.scm.grouped.repositories' , ( ) => this . setView ( 'repositories' ) ) ,
38- registerCommand ( 'gitlens.views.scm.grouped.searchAndCompare' , ( ) => this . setView ( 'searchAndCompare' ) ) ,
39- registerCommand ( 'gitlens.views.scm.grouped.stashes' , ( ) => this . setView ( 'stashes' ) ) ,
40- registerCommand ( 'gitlens.views.scm.grouped.tags' , ( ) => this . setView ( 'tags' ) ) ,
41- registerCommand ( 'gitlens.views.scm.grouped.worktrees' , ( ) => this . setView ( 'worktrees' ) ) ,
33+ registerCommand ( 'gitlens.views.scm.grouped.branches' , ( ) => this . setView ( 'branches' , true ) ) ,
34+ registerCommand ( 'gitlens.views.scm.grouped.commits' , ( ) => this . setView ( 'commits' , true ) ) ,
35+ registerCommand ( 'gitlens.views.scm.grouped.contributors' , ( ) => this . setView ( 'contributors' , true ) ) ,
36+ registerCommand ( 'gitlens.views.scm.grouped.remotes' , ( ) => this . setView ( 'remotes' , true ) ) ,
37+ registerCommand ( 'gitlens.views.scm.grouped.repositories' , ( ) => this . setView ( 'repositories' , true ) ) ,
38+ registerCommand ( 'gitlens.views.scm.grouped.searchAndCompare' , ( ) => this . setView ( 'searchAndCompare' , true ) ) ,
39+ registerCommand ( 'gitlens.views.scm.grouped.stashes' , ( ) => this . setView ( 'stashes' , true ) ) ,
40+ registerCommand ( 'gitlens.views.scm.grouped.tags' , ( ) => this . setView ( 'tags' , true ) ) ,
41+ registerCommand ( 'gitlens.views.scm.grouped.worktrees' , ( ) => this . setView ( 'worktrees' , true ) ) ,
4242 ) ;
4343
4444 this . _view = this . setView ( this . views . lastSelectedScmGroupedView ! ) ;
@@ -49,7 +49,7 @@ export class ScmGroupedView implements Disposable {
4949 this . _view ?. dispose ( ) ;
5050 }
5151
52- setView < T extends GroupableTreeViewTypes > ( type : T ) : TreeViewByType [ T ] {
52+ setView < T extends GroupableTreeViewTypes > ( type : T , focus ?: boolean ) : TreeViewByType [ T ] {
5353 if ( ! this . views . scmGroupedViews . has ( type ) ) {
5454 type = first ( this . views . scmGroupedViews ) as T ;
5555 }
@@ -61,7 +61,9 @@ export class ScmGroupedView implements Disposable {
6161
6262 this . _view ?. dispose ( ) ;
6363 this . _view = this . getView ( type ) ;
64- void this . _view . show ( { preserveFocus : false } ) ;
64+ if ( focus ) {
65+ void this . _view . show ( { preserveFocus : false } ) ;
66+ }
6567 this . views . lastSelectedScmGroupedView = type ;
6668
6769 return this . _view as TreeViewByType [ T ] ;
0 commit comments