From e2c8b16c4b9e6b2d184feb03ba825a700536d632 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Wed, 10 May 2023 16:04:57 +0200 Subject: [PATCH] Print empty line between file headers --- pkg/cmd/search/code/code.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/cmd/search/code/code.go b/pkg/cmd/search/code/code.go index 48ff7179c..e79b371f6 100644 --- a/pkg/cmd/search/code/code.go +++ b/pkg/cmd/search/code/code.go @@ -136,7 +136,10 @@ func displayResults(io *iostreams.IOStreams, results search.CodeResult) error { cs := io.ColorScheme() if io.IsStdoutTTY() { fmt.Fprintf(io.Out, "\nShowing %d of %d results\n\n", len(results.Items), results.Total) - for _, code := range results.Items { + for i, code := range results.Items { + if i > 0 { + fmt.Fprint(io.Out, "\n") + } fmt.Fprintf(io.Out, "%s %s\n", cs.Blue(code.Repo.FullName), cs.GreenBold(code.Path)) for _, match := range code.TextMatches { lines := formatMatch(match.Fragment, match.Matches, io.ColorEnabled())