Skip to content

Commit

Permalink
fixes #104047
Browse files Browse the repository at this point in the history
  • Loading branch information
joaomoreno committed Sep 10, 2020
1 parent abb9c8d commit 149f31e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
10 changes: 10 additions & 0 deletions src/vs/workbench/contrib/scm/browser/media/scm.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@
position: relative;
}

.scm-overflow-widgets-container {
position: absolute;
top: 0;
left: 0;
width: 0;
height: 0;
overflow: visible;
z-index: 5000;
}

.scm-view .monaco-tl-contents > div {
margin-right: 12px;
overflow: hidden;
Expand Down
14 changes: 10 additions & 4 deletions src/vs/workbench/contrib/scm/browser/scmViewPane.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ class InputRenderer implements ICompressibleTreeRenderer<ISCMInput, FuzzyScore,

constructor(
private outerLayout: ISCMLayout,
private overflowWidgetsDomNode: HTMLElement,
private updateHeight: (input: ISCMInput, height: number) => void,
@IInstantiationService private instantiationService: IInstantiationService,
) { }
Expand All @@ -147,7 +148,7 @@ class InputRenderer implements ICompressibleTreeRenderer<ISCMInput, FuzzyScore,

const disposables = new DisposableStore();
const inputElement = append(container, $('.scm-input'));
const inputWidget = this.instantiationService.createInstance(SCMInputWidget, inputElement);
const inputWidget = this.instantiationService.createInstance(SCMInputWidget, inputElement, this.overflowWidgetsDomNode);
disposables.add(inputWidget);

return { inputWidget, disposable: Disposable.None, templateDisposable: disposables };
Expand Down Expand Up @@ -1373,6 +1374,7 @@ class SCMInputWidget extends Disposable {

constructor(
container: HTMLElement,
overflowWidgetsDomNode: HTMLElement,
@IContextKeyService contextKeyService: IContextKeyService,
@IModelService private modelService: IModelService,
@IModeService private modeService: IModeService,
Expand Down Expand Up @@ -1402,7 +1404,8 @@ class SCMInputWidget extends Disposable {
wrappingIndent: 'none',
padding: { top: 3, bottom: 3 },
quickSuggestions: false,
scrollbar: { alwaysConsumeMouseWheel: false }
scrollbar: { alwaysConsumeMouseWheel: false },
overflowWidgetsDomNode
};

const codeEditorWidgetOptions: ICodeEditorWidgetOptions = {
Expand Down Expand Up @@ -1592,6 +1595,8 @@ export class SCMViewPane extends ViewPane {
// List
this.listContainer = append(container, $('.scm-view.show-file-icons'));

const overflowWidgetsDomNode = $('.scm-overflow-widgets-container.monaco-editor');

const updateActionsVisibility = () => toggleClass(this.listContainer, 'show-actions', this.configurationService.getValue<boolean>('scm.alwaysShowActions'));
this._register(Event.filter(this.configurationService.onDidChangeConfiguration, e => e.affectsConfiguration('scm.alwaysShowActions'))(updateActionsVisibility));
updateActionsVisibility();
Expand All @@ -1606,7 +1611,7 @@ export class SCMViewPane extends ViewPane {

this._register(this.scmViewService.onDidChangeVisibleRepositories(() => this.updateActions()));

this.inputRenderer = this.instantiationService.createInstance(InputRenderer, this.layoutCache, (input, height) => this.tree.updateElementHeight(input, height));
this.inputRenderer = this.instantiationService.createInstance(InputRenderer, this.layoutCache, overflowWidgetsDomNode, (input, height) => this.tree.updateElementHeight(input, height));
const delegate = new ListDelegate(this.inputRenderer);

const actionViewItemProvider = (action: IAction) => this.getActionViewItem(action);
Expand Down Expand Up @@ -1643,7 +1648,6 @@ export class SCMViewPane extends ViewPane {
filter,
sorter,
keyboardNavigationLabelProvider,
transformOptimization: false,
overrideStyles: {
listBackground: this.viewDescriptorService.getViewLocationById(this.id) === ViewContainerLocation.Sidebar ? SIDE_BAR_BACKGROUND : PANEL_BACKGROUND
},
Expand All @@ -1656,6 +1660,8 @@ export class SCMViewPane extends ViewPane {
this._register(this.tree.onDidScroll(this.inputRenderer.clearValidation, this.inputRenderer));
this._register(this.tree);

append(this.listContainer, overflowWidgetsDomNode);

let viewMode = this.configurationService.getValue<'tree' | 'list'>('scm.defaultViewMode') === 'list' ? ViewModelMode.List : ViewModelMode.Tree;
const storageMode = this.storageService.get(`scm.viewMode`, StorageScope.WORKSPACE) as ViewModelMode;

Expand Down

0 comments on commit 149f31e

Please sign in to comment.