diff --git a/internal/html/repo_search.templ b/internal/html/repo_search.templ
index 0dccff2..0995b2d 100644
--- a/internal/html/repo_search.templ
+++ b/internal/html/repo_search.templ
@@ -17,7 +17,7 @@ func (s SearchContext) DedupeResults() [][]git.GrepResult {
var idx int
for _, result := range s.Results {
if result.File == currentFile {
- results[idx] = append(results[idx], result)
+ results[idx-1] = append(results[idx-1], result)
continue
}
results = append(results, []git.GrepResult{result})
diff --git a/internal/html/repo_search_templ.go b/internal/html/repo_search_templ.go
index 3e33b3e..d23a975 100644
--- a/internal/html/repo_search_templ.go
+++ b/internal/html/repo_search_templ.go
@@ -27,7 +27,7 @@ func (s SearchContext) DedupeResults() [][]git.GrepResult {
var idx int
for _, result := range s.Results {
if result.File == currentFile {
- results[idx] = append(results[idx], result)
+ results[idx-1] = append(results[idx-1], result)
continue
}
results = append(results, []git.GrepResult{result})