File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
src/vs/workbench/browser/parts/views Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -496,12 +496,12 @@ abstract class AbstractTreeView extends Disposable implements ITreeView {
496496
497497 protected abstract activate ( ) : void ;
498498
499- focus ( reveal : boolean = true ) : void {
499+ focus ( reveal : boolean = true , revealItem ?: ITreeItem ) : void {
500500 if ( this . tree && this . root . children && this . root . children . length > 0 ) {
501501 // Make sure the current selected element is revealed
502- const selectedElement = this . tree . getSelection ( ) [ 0 ] ;
503- if ( selectedElement && reveal ) {
504- this . tree . reveal ( selectedElement , 0.5 ) ;
502+ const element = revealItem ?? this . tree . getSelection ( ) [ 0 ] ;
503+ if ( element && reveal ) {
504+ this . tree . reveal ( element , 0.5 ) ;
505505 }
506506
507507 // Pass Focus to Viewer
@@ -784,7 +784,7 @@ abstract class AbstractTreeView extends Disposable implements ITreeView {
784784
785785 setFocus ( item : ITreeItem ) : void {
786786 if ( this . tree ) {
787- this . focus ( ) ;
787+ this . focus ( true , item ) ;
788788 this . tree . setFocus ( [ item ] ) ;
789789 }
790790 }
You can’t perform that action at this time.
0 commit comments