File tree 3 files changed +9
-0
lines changed
src/vs/workbench/contrib/files
3 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -588,6 +588,13 @@ export class ExplorerView extends ViewPane {
588
588
return this . tree . updateChildren ( toRefresh , recursive ) ;
589
589
}
590
590
591
+ focusNextIfItemFocused ( item : ExplorerItem ) : void {
592
+ const focus = this . tree . getFocus ( ) ;
593
+ if ( focus . length === 1 && focus [ 0 ] === item ) {
594
+ this . tree . focusNext ( ) ;
595
+ }
596
+ }
597
+
591
598
getOptimalWidth ( ) : number {
592
599
const parentNode = this . tree . getHTMLElement ( ) ;
593
600
const childNodes = ( [ ] as HTMLElement [ ] ) . slice . call ( parentNode . querySelectorAll ( '.explorer-item .label-name' ) ) ; // select all file labels
Original file line number Diff line number Diff line change @@ -278,6 +278,7 @@ export class ExplorerService implements IExplorerService {
278
278
const parent = element . parent ;
279
279
// Remove Element from Parent (Model)
280
280
parent . removeChild ( element ) ;
281
+ this . view ?. focusNextIfItemFocused ( element ) ;
281
282
// Refresh Parent (View)
282
283
await this . view ?. refresh ( false , parent ) ;
283
284
}
Original file line number Diff line number Diff line change @@ -65,6 +65,7 @@ export interface IExplorerView {
65
65
setTreeInput ( ) : Promise < void > ;
66
66
itemsCopied ( tats : ExplorerItem [ ] , cut : boolean , previousCut : ExplorerItem [ ] | undefined ) : void ;
67
67
setEditable ( stat : ExplorerItem , isEditing : boolean ) : Promise < void > ;
68
+ focusNextIfItemFocused ( item : ExplorerItem ) : void ;
68
69
}
69
70
70
71
export const IExplorerService = createDecorator < IExplorerService > ( 'explorerService' ) ;
You can’t perform that action at this time.
0 commit comments