From fbf05e842ade1e74b3aee233dfa3a4440a9b62a8 Mon Sep 17 00:00:00 2001 From: Nikita Galaiko Date: Fri, 17 Mar 2023 15:39:19 +0100 Subject: [PATCH] apply correct amount of deltas from a search result --- src/routes/projects/[projectId]/search/+page.svelte | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/routes/projects/[projectId]/search/+page.svelte b/src/routes/projects/[projectId]/search/+page.svelte index f55a04a0f..559d49a0b 100644 --- a/src/routes/projects/[projectId]/search/+page.svelte +++ b/src/routes/projects/[projectId]/search/+page.svelte @@ -39,7 +39,9 @@ const { sessionId, projectId, filePath } = result; const [doc, deltas] = await Promise.all([ listFiles({ projectId, sessionId, paths: [filePath] }).then((r) => r[filePath] ?? ''), - listDeltas({ projectId, sessionId, paths: [filePath] }).then((r) => r[filePath] ?? []) + listDeltas({ projectId, sessionId, paths: [filePath] }) + .then((r) => r[filePath] ?? []) + .then((d) => d.slice(0, result.index + 1)) ]); processedResults = [ ...processedResults,