From 8a42dfc87c61a393983ad6da895e74056f9b2fac Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Thu, 4 Apr 2019 14:25:51 -0400 Subject: [PATCH] Show (no messages) for empty folders --- widgets/msglist.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/widgets/msglist.go b/widgets/msglist.go index d8d419e..d3c82a5 100644 --- a/widgets/msglist.go +++ b/widgets/msglist.go @@ -89,6 +89,12 @@ func (ml *MessageList) Draw(ctx *ui.Context) { row += 1 } + if len(ml.store.Uids) == 0 { + msg := "(no messages)" + ctx.Printf((ctx.Width()/2)-(len(msg)/2), 0, + tcell.StyleDefault, "%s", msg) + } + if len(needsHeaders) != 0 { ml.store.FetchHeaders(needsHeaders, nil) ml.spinner.Start()