@ -21,7 +21,6 @@ import { GitUri } from '../git/gitUri';
import { Logger } from '../logger' ;
import { Functions } from '../system' ;
import { RefreshNodeCommandArgs } from '../views/explorerCommands' ;
import { GitExplorer } from './gitExplorer' ;
import { Explorer , ExplorerNode , HistoryNode , MessageNode , RefreshReason } from './nodes' ;
export * from './nodes' ;
@ -47,12 +46,12 @@ export class HistoryExplorer extends Disposable implements TreeDataProvider
commands . registerCommand (
'gitlens.historyExplorer.setRenameFollowingOn' ,
( ) = > Git Explorer. setRenameFollowing ( true ) ,
( ) = > History Explorer. setRenameFollowing ( true ) ,
this
) ;
commands . registerCommand (
'gitlens.historyExplorer.setRenameFollowingOff' ,
( ) = > Git Explorer. setRenameFollowing ( false ) ,
( ) = > History Explorer. setRenameFollowing ( false ) ,
this
) ;
@ -158,12 +157,12 @@ export class HistoryExplorer extends Disposable implements TreeDataProvider
async dock ( switchView : boolean = true , updateConfig : boolean = true ) {
if ( switchView ) {
await Container . gitExplorer . switchTo ( GitExplorerView . History ) ;
void ( await Container . gitExplorer . switchTo ( GitExplorerView . History ) ) ;
}
await setCommandContext ( CommandContext . HistoryExplorer , false ) ;
void ( await setCommandContext ( CommandContext . HistoryExplorer , false ) ) ;
if ( updateConfig ) {
await configuration . updateEffective ( configuration . name ( 'historyExplorer' ) ( 'enabled' ) . value , false ) ;
void ( await configuration . updateEffective ( configuration . name ( 'historyExplorer' ) ( 'enabled' ) . value , false ) ) ;
}
}
@ -211,12 +210,12 @@ export class HistoryExplorer extends Disposable implements TreeDataProvider
async undock ( switchView : boolean = true , updateConfig : boolean = true ) {
if ( switchView ) {
await Container . gitExplorer . switchTo ( GitExplorerView . Repository ) ;
void ( await Container . gitExplorer . switchTo ( GitExplorerView . Repository ) ) ;
}
await setCommandContext ( CommandContext . HistoryExplorer , this . config . location ) ;
void ( await setCommandContext ( CommandContext . HistoryExplorer , this . config . location ) ) ;
if ( updateConfig ) {
await configuration . updateEffective ( configuration . name ( 'historyExplorer' ) ( 'enabled' ) . value , true ) ;
void ( await configuration . updateEffective ( configuration . name ( 'historyExplorer' ) ( 'enabled' ) . value , true ) ) ;
}
}
@ -227,7 +226,7 @@ export class HistoryExplorer extends Disposable implements TreeDataProvider
this . _root = undefined ;
}
private async getRootNode ( editor : TextEditor | undefined ) : Promise < ExplorerNode | undefined > {
private getRootNode ( editor : TextEditor | undefined ) : Promise < ExplorerNode | undefined > {
return HistoryExplorer . getHistoryNode ( this , editor , this . _root ) ;
}
@ -285,4 +284,11 @@ export class HistoryExplorer extends Disposable implements TreeDataProvider
}
return new HistoryNode ( gitUri , repo , explorer ) ;
}
static setRenameFollowing ( enabled : boolean ) {
return configuration . updateEffective (
configuration . name ( 'advanced' ) ( 'fileHistoryFollowsRenames' ) . value ,
enabled
) ;
}
}