Skip to content

Commit 35ce8ff

Browse files
committed
Update vlist API use
1 parent 79a61e8 commit 35ce8ff

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
@@ -324,8 +324,8 @@ export class MultiFileDiffViewerState {
324324
if (!this.vlist) return;
325325
const fileIdx = file.index;
326326
this.fileStates[fileIdx].collapsed = false;
327-
const startIdx = this.vlist.findStartIndex();
328-
const endIdx = this.vlist.findEndIndex();
327+
const startIdx = this.vlist.findItemIndex(this.vlist.scrollOffset);
328+
const endIdx = this.vlist.findItemIndex(this.vlist.scrollOffset + this.vlist.viewportSize);
329329
if (fileIdx < startIdx || fileIdx > endIdx) {
330330
this.vlist.scrollToIndex(fileIdx, { align: "start" });
331331
}

0 commit comments

Comments
 (0)