From 664d2ef30b9988a35001c5771eca23bf18c515b6 Mon Sep 17 00:00:00 2001 From: Simon Cambier Date: Tue, 26 Apr 2022 21:51:10 +0200 Subject: [PATCH] Fixed the InFile's `searchQuery` that was overwritten by an empty `lastSearch` --- src/components/ModalInFile.svelte | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/ModalInFile.svelte b/src/components/ModalInFile.svelte index 309e2a9..cd6e047 100644 --- a/src/components/ModalInFile.svelte +++ b/src/components/ModalInFile.svelte @@ -28,7 +28,9 @@ let selectedIndex = 0 let note: ResultNote | null = null onMount(() => { - searchQuery = lastSearch + if (lastSearch && !searchQuery) { + searchQuery = lastSearch + } eventBus.disable("vault") eventBus.on("infile", "enter", openSelection) @@ -61,7 +63,7 @@ $: { } /** - * Group together close + * Group together close matches to reduce the number of results */ function getGroups(matches: SearchMatch[]): SearchMatch[][] { const groups: SearchMatch[][] = []