@@ -49,6 +49,7 @@ import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService
4949import { isMacintosh } from 'vs/base/common/platform' ;
5050import { KeyCode } from 'vs/base/common/keyCodes' ;
5151import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent' ;
52+ import { withNullAsUndefined } from 'vs/base/common/types' ;
5253
5354export class ExplorerView extends ViewletPanel {
5455 static readonly ID : string = 'workbench.explorer.fileView' ;
@@ -258,7 +259,7 @@ export class ExplorerView extends ViewletPanel {
258259 // No action needed, active file is already focused
259260 return ;
260261 }
261- this . explorerService . select ( this . getActiveFile ( ) , reveal ) ;
262+ this . explorerService . select ( activeFile , reveal ) ;
262263 } else if ( deselect ) {
263264 this . tree . setSelection ( [ ] ) ;
264265 this . tree . setFocus ( [ ] ) ;
@@ -408,7 +409,7 @@ export class ExplorerView extends ViewletPanel {
408409 private onFocusChanged ( elements : ExplorerItem [ ] ) : void {
409410 const stat = elements && elements . length ? elements [ 0 ] : undefined ;
410411 const isSingleFolder = this . contextService . getWorkbenchState ( ) === WorkbenchState . FOLDER ;
411- const resource = stat ? stat . resource : isSingleFolder ? this . contextService . getWorkspace ( ) . folders [ 0 ] . uri : undefined ;
412+ const resource = stat ? stat . resource : isSingleFolder ? this . contextService . getWorkspace ( ) . folders [ 0 ] . uri : null ;
412413 this . resourceContext . set ( resource ) ;
413414 this . folderContext . set ( ( isSingleFolder && ! stat ) || ! ! stat && stat . isDirectory ) ;
414415 this . readonlyContext . set ( ! ! stat && stat . isReadonly ) ;
@@ -504,7 +505,7 @@ export class ExplorerView extends ViewletPanel {
504505 }
505506
506507 // check for files
507- return toResource ( input , { supportSideBySide : true } ) ;
508+ return withNullAsUndefined ( toResource ( input , { supportSideBySide : true } ) ) ;
508509 }
509510
510511 private onSelectItem ( fileStat : ExplorerItem , reveal = this . autoReveal ) : Promise < void > {
0 commit comments