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 {
496
496
497
497
protected abstract activate ( ) : void ;
498
498
499
- focus ( reveal : boolean = true ) : void {
499
+ focus ( reveal : boolean = true , revealItem ?: ITreeItem ) : void {
500
500
if ( this . tree && this . root . children && this . root . children . length > 0 ) {
501
501
// 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 ) ;
505
505
}
506
506
507
507
// Pass Focus to Viewer
@@ -784,7 +784,7 @@ abstract class AbstractTreeView extends Disposable implements ITreeView {
784
784
785
785
setFocus ( item : ITreeItem ) : void {
786
786
if ( this . tree ) {
787
- this . focus ( ) ;
787
+ this . focus ( true , item ) ;
788
788
this . tree . setFocus ( [ item ] ) ;
789
789
}
790
790
}
You can’t perform that action at this time.
0 commit comments