We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 79a61e8 commit 35ce8ffCopy full SHA for 35ce8ff
web/src/lib/diff-viewer.svelte.ts
@@ -324,8 +324,8 @@ export class MultiFileDiffViewerState {
324
if (!this.vlist) return;
325
const fileIdx = file.index;
326
this.fileStates[fileIdx].collapsed = false;
327
- const startIdx = this.vlist.findStartIndex();
328
- const endIdx = this.vlist.findEndIndex();
+ const startIdx = this.vlist.findItemIndex(this.vlist.scrollOffset);
+ const endIdx = this.vlist.findItemIndex(this.vlist.scrollOffset + this.vlist.viewportSize);
329
if (fileIdx < startIdx || fileIdx > endIdx) {
330
this.vlist.scrollToIndex(fileIdx, { align: "start" });
331
}
0 commit comments