提交 8ed35130 编写于 作者: A Alex Dima

Fixes #43144

上级 130981bc
......@@ -188,6 +188,7 @@ export abstract class ZoneWidget implements IHorizontalSashLayoutProvider {
this._disposables.push(this.editor.onDidLayoutChange((info: EditorLayoutInfo) => {
const width = this._getWidth(info);
this.domNode.style.width = width + 'px';
this.domNode.style.left = this._getLeft(info) + 'px';
this._onWidth(width);
}));
}
......@@ -250,10 +251,18 @@ export abstract class ZoneWidget implements IHorizontalSashLayoutProvider {
}
}
private _getWidth(info: EditorLayoutInfo = this.editor.getLayoutInfo()): number {
private _getWidth(info: EditorLayoutInfo): number {
return info.width - info.minimapWidth - info.verticalScrollbarWidth;
}
private _getLeft(info: EditorLayoutInfo): number {
// If minimap is to the left, we move beyond it
if (info.minimapWidth > 0 && info.minimapLeft === 0) {
return info.minimapWidth;
}
return 0;
}
private _onViewZoneTop(top: number): void {
this.domNode.style.top = top + 'px';
}
......@@ -263,7 +272,8 @@ export abstract class ZoneWidget implements IHorizontalSashLayoutProvider {
let containerHeight = height - this._decoratingElementsHeight();
this.container.style.height = `${containerHeight}px`;
this._doLayout(containerHeight, this._getWidth());
const layoutInfo = this.editor.getLayoutInfo();
this._doLayout(containerHeight, this._getWidth(layoutInfo));
this._resizeSash.layout();
}
......@@ -328,8 +338,10 @@ export abstract class ZoneWidget implements IHorizontalSashLayoutProvider {
column: where.startColumn
};
const width = this._getWidth();
const layoutInfo = this.editor.getLayoutInfo();
const width = this._getWidth(layoutInfo);
this.domNode.style.width = `${width}px`;
this.domNode.style.left = this._getLeft(layoutInfo) + 'px';
// Render the widget as zone (rendering) and widget (lifecycle)
const viewZoneDomNode = document.createElement('div');
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册