Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/diffs/src/components/CodeView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -981,13 +981,13 @@ export class CodeView<LAnnotation = undefined> {
};
}

public getTopForInstance(
public getLocalTopForInstance(
instance: VirtualizedFile<LAnnotation> | VirtualizedFileDiff<LAnnotation>
): number {
const item = this.instanceToItem.get(instance);
if (item == null) {
throw new Error(
'CodeView.getTopForInstance: unknown virtualized instance'
'CodeView.getLocalTopForInstance: unknown virtualized instance'
);
}
return item.top;
Expand All @@ -998,7 +998,7 @@ export class CodeView<LAnnotation = undefined> {
if (item == null) {
return undefined;
}
return item.top;
return item.top + this.getViewerMetrics().paddingTop;
}

private createItem(
Expand Down
2 changes: 1 addition & 1 deletion packages/diffs/src/components/VirtualizedFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ export class VirtualizedFile<

private getVirtualizedTop(): number {
if (this.virtualizer.type === 'advanced') {
return this.virtualizer.getTopForInstance(this);
return this.virtualizer.getLocalTopForInstance(this);
}
return this.fileContainer != null
? this.virtualizer.getOffsetInScrollContainer(this.fileContainer)
Expand Down
2 changes: 1 addition & 1 deletion packages/diffs/src/components/VirtualizedFileDiff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ export class VirtualizedFileDiff<

private getVirtualizedTop(): number | undefined {
if (this.virtualizer.type === 'advanced') {
return this.virtualizer.getTopForInstance(this);
return this.virtualizer.getLocalTopForInstance(this);
}
return this.fileContainer != null
? this.virtualizer.getOffsetInScrollContainer(this.fileContainer)
Expand Down
Loading