Skip to content

Commit

Permalink
[fix] fix line feed position
Browse files Browse the repository at this point in the history
  • Loading branch information
sheepla committed Dec 31, 2021
1 parent 4ae26c4 commit 9f61f15
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,18 @@ func main() {
choices, err := fuzzyfinder.FindMulti(
result.Query.Search,
func(i int) string { return result.Query.Search[i].Title },
fuzzyfinder.WithPreviewWindow(func(i, w, h int) string {
if i == -1 {
return ""
}
return fmt.Sprintf(
"%s\n\n%s\n\n%s",
result.Query.Search[i].Title,
runewidth.Wrap(result.Query.Search[i].Snippet, w),
humanize.Time(result.Query.Search[i].Timestamp),
)
},
fuzzyfinder.WithPreviewWindow(
func(i, w, h int) string {
if i == -1 {
return ""
}
return fmt.Sprintf(
"%s\n\n%s\n\n%s",
result.Query.Search[i].Title,
runewidth.Wrap(result.Query.Search[i].Snippet, w),
humanize.Time(result.Query.Search[i].Timestamp),
)
},
),
)

Expand Down

0 comments on commit 9f61f15

Please sign in to comment.