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 82632bb commit eeddb8aCopy full SHA for eeddb8a
web/src/routes/DiffSearch.svelte
@@ -16,6 +16,10 @@
16
17
async function prevResult() {
18
const files = await viewer.searchResults;
19
+ if (files.totalMatches === 0) {
20
+ currentMatchIdx = -1;
21
+ return;
22
+ }
23
const startIdx = currentMatchIdx == -1 ? 0 : currentMatchIdx;
24
currentMatchIdx = (startIdx - 1 + files.totalMatches) % files.totalMatches;
25
viewer.activeSearchResult = files.getLocation(currentMatchIdx);
@@ -24,6 +28,10 @@
28
29
async function nextResult() {
26
30
31
32
33
34
27
35
currentMatchIdx = (currentMatchIdx + 1) % files.totalMatches;
36
37
await scrollToMatch();
0 commit comments