@@ -43,11 +43,11 @@ import { compareFileNames, comparePaths } from 'vs/base/common/comparers';
4343import { FuzzyScore , createMatches , IMatch } from 'vs/base/common/filters' ;
4444import { IViewDescriptorService } from 'vs/workbench/common/views' ;
4545import { localize } from 'vs/nls' ;
46- import { flatten , find } from 'vs/base/common/arrays' ;
46+ import { flatten } from 'vs/base/common/arrays' ;
4747import { memoize } from 'vs/base/common/decorators' ;
4848import { IStorageService , StorageScope } from 'vs/platform/storage/common/storage' ;
4949import { toResource , SideBySideEditor } from 'vs/workbench/common/editor' ;
50- import { SIDE_BAR_BACKGROUND } from 'vs/workbench/common/theme' ;
50+ import { SIDE_BAR_BACKGROUND , SIDE_BAR_BORDER } from 'vs/workbench/common/theme' ;
5151import { CodeEditorWidget , ICodeEditorWidgetOptions } from 'vs/editor/browser/widget/codeEditorWidget' ;
5252import { ITextModel } from 'vs/editor/common/model' ;
5353import { IEditorConstructionOptions } from 'vs/editor/common/config/editorOptions' ;
@@ -989,7 +989,7 @@ class ViewModel {
989989 const groupItem = item . groupItems [ j ] ;
990990 const resource = this . mode === ViewModelMode . Tree
991991 ? groupItem . tree . getNode ( uri ) ?. element
992- : find ( groupItem . resources , r => isEqual ( r . sourceUri , uri ) ) ;
992+ : groupItem . resources . find ( r => isEqual ( r . sourceUri , uri ) ) ;
993993
994994 if ( resource ) {
995995 this . tree . reveal ( resource ) ;
@@ -1002,22 +1002,22 @@ class ViewModel {
10021002 }
10031003
10041004 getViewActions ( ) : IAction [ ] {
1005- if ( this . items . length !== 1 ) {
1005+ if ( this . repositories . elements . length !== 1 ) {
10061006 return [ ] ;
10071007 }
10081008
1009- const menus = this . menus . getRepositoryMenus ( this . items [ 0 ] . element . provider ) ;
1009+ const menus = this . menus . getRepositoryMenus ( this . repositories . elements [ 0 ] . provider ) ;
10101010 return menus . getTitleActions ( ) ;
10111011 }
10121012
10131013 getViewSecondaryActions ( ) : IAction [ ] {
10141014 const viewAction = new SCMViewSubMenuAction ( this ) ;
10151015
1016- if ( this . items . length !== 1 ) {
1017- return [ viewAction ] ;
1016+ if ( this . repositories . elements . length !== 1 ) {
1017+ return viewAction . entries ;
10181018 }
10191019
1020- const menus = this . menus . getRepositoryMenus ( this . items [ 0 ] . element . provider ) ;
1020+ const menus = this . menus . getRepositoryMenus ( this . repositories . elements [ 0 ] . provider ) ;
10211021 const secondaryActions = menus . getTitleSecondaryActions ( ) ;
10221022
10231023 if ( secondaryActions . length === 0 ) {
@@ -1028,11 +1028,11 @@ class ViewModel {
10281028 }
10291029
10301030 getViewActionsContext ( ) : any {
1031- if ( this . items . length !== 1 ) {
1031+ if ( this . repositories . elements . length !== 1 ) {
10321032 return undefined ;
10331033 }
10341034
1035- return this . items [ 0 ] . element . provider ;
1035+ return this . repositories . elements [ 0 ] . provider ;
10361036 }
10371037
10381038 dispose ( ) : void {
@@ -1452,6 +1452,8 @@ export class SCMViewPane extends ViewPane {
14521452 this . menus = this . instantiationService . createInstance ( SCMMenus , repositories ) ;
14531453 this . _register ( this . menus ) ;
14541454
1455+ this . _register ( repositories . onDidSplice ( ( ) => this . updateActions ( ) ) ) ;
1456+
14551457 const delegate = new ProviderListDelegate ( ) ;
14561458
14571459 const actionViewItemProvider = ( action : IAction ) => this . getActionViewItem ( action ) ;
@@ -1759,4 +1761,9 @@ registerThemingParticipant((theme, collector) => {
17591761 if ( inputValidationErrorForegroundColor ) {
17601762 collector . addRule ( `.scm-viewlet .scm-editor-validation.validation-error { color: ${ inputValidationErrorForegroundColor } ; }` ) ;
17611763 }
1764+
1765+ const repositoryStatusActionsBorderColor = theme . getColor ( SIDE_BAR_BORDER ) ;
1766+ if ( repositoryStatusActionsBorderColor ) {
1767+ collector . addRule ( `.scm-viewlet .scm-provider > .status > .monaco-action-bar > .actions-container { border-color: ${ repositoryStatusActionsBorderColor } ; }` ) ;
1768+ }
17621769} ) ;
0 commit comments