@@ -244,6 +244,7 @@ export class WorkbenchList<T> extends List<T> {
244244 private listHasSelectionOrFocus : IContextKey < boolean > ;
245245 private listDoubleSelection : IContextKey < boolean > ;
246246 private listMultiSelection : IContextKey < boolean > ;
247+ private horizontalScrolling : boolean | undefined ;
247248
248249 private _styler : IDisposable | undefined ;
249250 private _useAltAsMultipleSelectionModifier : boolean ;
@@ -284,6 +285,7 @@ export class WorkbenchList<T> extends List<T> {
284285 this . listHasSelectionOrFocus = WorkbenchListHasSelectionOrFocus . bindTo ( this . contextKeyService ) ;
285286 this . listDoubleSelection = WorkbenchListDoubleSelection . bindTo ( this . contextKeyService ) ;
286287 this . listMultiSelection = WorkbenchListMultiSelection . bindTo ( this . contextKeyService ) ;
288+ this . horizontalScrolling = options . horizontalScrolling ;
287289
288290 this . _useAltAsMultipleSelectionModifier = useAltAsMultipleSelectionModifier ( configurationService ) ;
289291
@@ -340,6 +342,10 @@ export class WorkbenchList<T> extends List<T> {
340342 if ( e . affectsConfiguration ( multiSelectModifierSettingKey ) ) {
341343 this . _useAltAsMultipleSelectionModifier = useAltAsMultipleSelectionModifier ( this . configurationService ) ;
342344 }
345+ if ( e . affectsConfiguration ( horizontalScrollingKey ) && this . horizontalScrolling === undefined ) {
346+ const horizontalScrolling = this . configurationService . getValue < boolean > ( horizontalScrollingKey ) ;
347+ this . updateOptions ( { horizontalScrolling } ) ;
348+ }
343349 } ) ) ;
344350 }
345351
@@ -360,6 +366,7 @@ export class WorkbenchPagedList<T> extends PagedList<T> {
360366 private readonly disposables : DisposableStore ;
361367
362368 private _useAltAsMultipleSelectionModifier : boolean ;
369+ private horizontalScrolling : boolean | undefined ;
363370
364371 constructor (
365372 user : string ,
@@ -389,6 +396,7 @@ export class WorkbenchPagedList<T> extends PagedList<T> {
389396
390397 this . contextKeyService = createScopedContextKeyService ( contextKeyService , this ) ;
391398 this . configurationService = configurationService ;
399+ this . horizontalScrolling = options . horizontalScrolling ;
392400
393401 const listSupportsMultiSelect = WorkbenchListSupportsMultiSelectContextKey . bindTo ( this . contextKeyService ) ;
394402 listSupportsMultiSelect . set ( ! ( options . multipleSelectionSupport === false ) ) ;
@@ -410,6 +418,10 @@ export class WorkbenchPagedList<T> extends PagedList<T> {
410418 if ( e . affectsConfiguration ( multiSelectModifierSettingKey ) ) {
411419 this . _useAltAsMultipleSelectionModifier = useAltAsMultipleSelectionModifier ( this . configurationService ) ;
412420 }
421+ if ( e . affectsConfiguration ( horizontalScrollingKey ) && this . horizontalScrolling === undefined ) {
422+ const horizontalScrolling = this . configurationService . getValue < boolean > ( horizontalScrollingKey ) ;
423+ this . updateOptions ( { horizontalScrolling } ) ;
424+ }
413425 } ) ) ;
414426 }
415427
@@ -608,7 +620,7 @@ export class WorkbenchObjectTree<T extends NonNullable<any>, TFilterData = void>
608620 const { options : treeOptions , getAutomaticKeyboardNavigation, disposable } = workbenchTreeDataPreamble < T , TFilterData , IWorkbenchObjectTreeOptions < T , TFilterData > > ( container , options , contextKeyService , configurationService , keybindingService , accessibilityService ) ;
609621 super ( user , container , delegate , renderers , treeOptions ) ;
610622 this . disposables . add ( disposable ) ;
611- this . internals = new WorkbenchTreeInternals ( this , treeOptions , getAutomaticKeyboardNavigation , options . overrideStyles , contextKeyService , listService , themeService , configurationService , accessibilityService ) ;
623+ this . internals = new WorkbenchTreeInternals ( this , options , getAutomaticKeyboardNavigation , options . overrideStyles , contextKeyService , listService , themeService , configurationService , accessibilityService ) ;
612624 this . disposables . add ( this . internals ) ;
613625 }
614626}
@@ -643,7 +655,7 @@ export class WorkbenchCompressibleObjectTree<T extends NonNullable<any>, TFilter
643655 const { options : treeOptions , getAutomaticKeyboardNavigation, disposable } = workbenchTreeDataPreamble < T , TFilterData , IWorkbenchCompressibleObjectTreeOptions < T , TFilterData > > ( container , options , contextKeyService , configurationService , keybindingService , accessibilityService ) ;
644656 super ( user , container , delegate , renderers , treeOptions ) ;
645657 this . disposables . add ( disposable ) ;
646- this . internals = new WorkbenchTreeInternals ( this , treeOptions , getAutomaticKeyboardNavigation , options . overrideStyles , contextKeyService , listService , themeService , configurationService , accessibilityService ) ;
658+ this . internals = new WorkbenchTreeInternals ( this , options , getAutomaticKeyboardNavigation , options . overrideStyles , contextKeyService , listService , themeService , configurationService , accessibilityService ) ;
647659 this . disposables . add ( this . internals ) ;
648660 }
649661
@@ -687,7 +699,7 @@ export class WorkbenchDataTree<TInput, T, TFilterData = void> extends DataTree<T
687699 const { options : treeOptions , getAutomaticKeyboardNavigation, disposable } = workbenchTreeDataPreamble < T , TFilterData , IWorkbenchDataTreeOptions < T , TFilterData > > ( container , options , contextKeyService , configurationService , keybindingService , accessibilityService ) ;
688700 super ( user , container , delegate , renderers , dataSource , treeOptions ) ;
689701 this . disposables . add ( disposable ) ;
690- this . internals = new WorkbenchTreeInternals ( this , treeOptions , getAutomaticKeyboardNavigation , options . overrideStyles , contextKeyService , listService , themeService , configurationService , accessibilityService ) ;
702+ this . internals = new WorkbenchTreeInternals ( this , options , getAutomaticKeyboardNavigation , options . overrideStyles , contextKeyService , listService , themeService , configurationService , accessibilityService ) ;
691703 this . disposables . add ( this . internals ) ;
692704 }
693705
@@ -731,7 +743,7 @@ export class WorkbenchAsyncDataTree<TInput, T, TFilterData = void> extends Async
731743 const { options : treeOptions , getAutomaticKeyboardNavigation, disposable } = workbenchTreeDataPreamble < T , TFilterData , IWorkbenchAsyncDataTreeOptions < T , TFilterData > > ( container , options , contextKeyService , configurationService , keybindingService , accessibilityService ) ;
732744 super ( user , container , delegate , renderers , dataSource , treeOptions ) ;
733745 this . disposables . add ( disposable ) ;
734- this . internals = new WorkbenchTreeInternals ( this , treeOptions , getAutomaticKeyboardNavigation , options . overrideStyles , contextKeyService , listService , themeService , configurationService , accessibilityService ) ;
746+ this . internals = new WorkbenchTreeInternals ( this , options , getAutomaticKeyboardNavigation , options . overrideStyles , contextKeyService , listService , themeService , configurationService , accessibilityService ) ;
735747 this . disposables . add ( this . internals ) ;
736748 }
737749
@@ -773,7 +785,7 @@ export class WorkbenchCompressibleAsyncDataTree<TInput, T, TFilterData = void> e
773785 const { options : treeOptions , getAutomaticKeyboardNavigation, disposable } = workbenchTreeDataPreamble < T , TFilterData , IWorkbenchCompressibleAsyncDataTreeOptions < T , TFilterData > > ( container , options , contextKeyService , configurationService , keybindingService , accessibilityService ) ;
774786 super ( user , container , virtualDelegate , compressionDelegate , renderers , dataSource , treeOptions ) ;
775787 this . disposables . add ( disposable ) ;
776- this . internals = new WorkbenchTreeInternals ( this , treeOptions , getAutomaticKeyboardNavigation , options . overrideStyles , contextKeyService , listService , themeService , configurationService , accessibilityService ) ;
788+ this . internals = new WorkbenchTreeInternals ( this , options , getAutomaticKeyboardNavigation , options . overrideStyles , contextKeyService , listService , themeService , configurationService , accessibilityService ) ;
777789 this . disposables . add ( this . internals ) ;
778790 }
779791}
@@ -806,7 +818,7 @@ function workbenchTreeDataPreamble<T, TFilterData, TOptions extends IAbstractTre
806818
807819 const accessibilityOn = accessibilityService . isScreenReaderOptimized ( ) ;
808820 const keyboardNavigation = accessibilityOn ? 'simple' : configurationService . getValue < string > ( keyboardNavigationSettingKey ) ;
809- const horizontalScrolling = typeof options . horizontalScrolling !== ' undefined' ? options . horizontalScrolling : configurationService . getValue < boolean > ( horizontalScrollingKey ) ;
821+ const horizontalScrolling = options . horizontalScrolling !== undefined ? options . horizontalScrolling : configurationService . getValue < boolean > ( horizontalScrollingKey ) ;
810822 const openOnSingleClick = useSingleClickToOpen ( configurationService ) ;
811823 const [ workbenchListOptions , disposable ] = toWorkbenchListOptions ( options , configurationService , keybindingService ) ;
812824 const additionalScrollHeight = options . additionalScrollHeight ;
@@ -896,33 +908,37 @@ class WorkbenchTreeInternals<TInput, T, TFilterData> {
896908 this . hasSelectionOrFocus . set ( selection . length > 0 || focus . length > 0 ) ;
897909 } ) ,
898910 configurationService . onDidChangeConfiguration ( e => {
899- let options : any = { } ;
911+ let newOptions : any = { } ;
900912 if ( e . affectsConfiguration ( openModeSettingKey ) ) {
901- options = { ...options , openOnSingleClick : useSingleClickToOpen ( configurationService ) } ;
913+ newOptions = { ...newOptions , openOnSingleClick : useSingleClickToOpen ( configurationService ) } ;
902914 }
903915 if ( e . affectsConfiguration ( multiSelectModifierSettingKey ) ) {
904916 this . _useAltAsMultipleSelectionModifier = useAltAsMultipleSelectionModifier ( configurationService ) ;
905917 }
906918 if ( e . affectsConfiguration ( treeIndentKey ) ) {
907919 const indent = configurationService . getValue < number > ( treeIndentKey ) ;
908- options = { ...options , indent } ;
920+ newOptions = { ...newOptions , indent } ;
909921 }
910922 if ( e . affectsConfiguration ( treeRenderIndentGuidesKey ) ) {
911923 const renderIndentGuides = configurationService . getValue < RenderIndentGuides > ( treeRenderIndentGuidesKey ) ;
912- options = { ...options , renderIndentGuides } ;
924+ newOptions = { ...newOptions , renderIndentGuides } ;
913925 }
914926 if ( e . affectsConfiguration ( listSmoothScrolling ) ) {
915927 const smoothScrolling = configurationService . getValue < boolean > ( listSmoothScrolling ) ;
916- options = { ...options , smoothScrolling } ;
928+ newOptions = { ...newOptions , smoothScrolling } ;
917929 }
918930 if ( e . affectsConfiguration ( keyboardNavigationSettingKey ) ) {
919931 updateKeyboardNavigation ( ) ;
920932 }
921933 if ( e . affectsConfiguration ( automaticKeyboardNavigationSettingKey ) ) {
922- options = { ...options , automaticKeyboardNavigation : getAutomaticKeyboardNavigation ( ) } ;
934+ newOptions = { ...newOptions , automaticKeyboardNavigation : getAutomaticKeyboardNavigation ( ) } ;
935+ }
936+ if ( e . affectsConfiguration ( horizontalScrollingKey ) && options . horizontalScrolling === undefined ) {
937+ const horizontalScrolling = configurationService . getValue < boolean > ( horizontalScrollingKey ) ;
938+ newOptions = { ...newOptions , horizontalScrolling } ;
923939 }
924- if ( Object . keys ( options ) . length > 0 ) {
925- tree . updateOptions ( options ) ;
940+ if ( Object . keys ( newOptions ) . length > 0 ) {
941+ tree . updateOptions ( newOptions ) ;
926942 }
927943 } ) ,
928944 this . contextKeyService . onDidChangeContext ( e => {
0 commit comments