Merge from vscode 64980ea1f3f532c82bb6c28d27bba9ef2c5b4463 (#7206)

* Merge from vscode 64980ea1f3f532c82bb6c28d27bba9ef2c5b4463

* fix config changes

* fix strictnull checks
This commit is contained in:
Anthony Dresser
2019-09-15 22:38:26 -07:00
committed by GitHub
parent fa6c52699e
commit ea0f9e6ce9
1226 changed files with 21541 additions and 17633 deletions

View File

@@ -125,15 +125,13 @@ abstract class ViewItem {
}
}
layout(_orthogonalSize: number | undefined): void {
this.container.scrollTop = 0;
this.container.scrollLeft = 0;
}
layoutView(orthogonalSize: number | undefined): void {
layout(position: number, orthogonalSize: number | undefined): void {
this.layoutContainer(position);
this.view.layout(this.size, orthogonalSize);
}
abstract layoutContainer(position: number): void;
dispose(): IView {
this.disposable.dispose();
return this.view;
@@ -142,19 +140,17 @@ abstract class ViewItem {
class VerticalViewItem extends ViewItem {
layout(orthogonalSize: number | undefined): void {
super.layout(orthogonalSize);
layoutContainer(position: number): void {
this.container.style.top = `${position}px`;
this.container.style.height = `${this.size}px`;
this.layoutView(orthogonalSize);
}
}
class HorizontalViewItem extends ViewItem {
layout(orthogonalSize: number | undefined): void {
super.layout(orthogonalSize);
layoutContainer(position: number): void {
this.container.style.left = `${position}px`;
this.container.style.width = `${this.size}px`;
this.layoutView(orthogonalSize);
}
}
@@ -853,7 +849,12 @@ export class SplitView extends Disposable {
this.contentSize = this.viewItems.reduce((r, i) => r + i.size, 0);
// Layout views
this.viewItems.forEach(item => item.layout(this.orthogonalSize));
let position = 0;
for (const viewItem of this.viewItems) {
viewItem.layout(position, this.orthogonalSize);
position += viewItem.size;
}
// Layout sashes
this.sashItems.forEach(item => item.sash.layout());
@@ -910,7 +911,7 @@ export class SplitView extends Disposable {
position += this.viewItems[i].size;
if (this.sashItems[i].sash === sash) {
return position;
return Math.min(position, this.contentSize - 2);
}
}