Skip to content

Commit 3f00ab5

Browse files
committed
Update vlist API use
1 parent 218a58e commit 3f00ab5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

web/src/lib/diff-viewer.svelte.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -532,8 +532,8 @@ export class MultiFileDiffViewerState {
532532
if (!this.vlist) return;
533533
const fileIdx = file.index;
534534
this.fileStates[fileIdx].collapsed = false;
535-
const startIdx = this.vlist.findStartIndex();
536-
const endIdx = this.vlist.findEndIndex();
535+
const startIdx = this.vlist.findItemIndex(this.vlist.scrollOffset);
536+
const endIdx = this.vlist.findItemIndex(this.vlist.scrollOffset + this.vlist.viewportSize);
537537
if (fileIdx < startIdx || fileIdx > endIdx) {
538538
this.vlist.scrollToIndex(fileIdx, { align: "start" });
539539
}

0 commit comments

Comments
 (0)