From 198a785ac4300f89112d1402ca0511b7ff8d300b Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Fri, 15 May 2020 18:44:22 -0400 Subject: [PATCH] Don't show the paginator if there's only one page --- ui/stash.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ui/stash.go b/ui/stash.go index a540b6c..242b908 100644 --- a/ui/stash.go +++ b/ui/stash.go @@ -263,13 +263,18 @@ func stashView(m stashModel) string { header = "Here’s your markdown stash:" } + var pageView string + if m.paginator.TotalPages > 1 { + pageView = paginator.View(m.paginator) + } + s += fmt.Sprintf( "%s\n\n%s\n\n%s\n\n%s%s\n\n%s", glowLogoView(" Glow "), header, stashPopulatedView(m), blankLines, - paginator.View(m.paginator), + pageView, helpView(m), ) }