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