about summary refs log tree commit diff stats
path: root/widgets/msglist.go
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2019-04-04 14:25:51 -0400
committerDrew DeVault <sir@cmpwn.com>2019-04-04 14:25:51 -0400
commit8a42dfc87c61a393983ad6da895e74056f9b2fac (patch)
treef3d239da0a4be75090858b16a2160b3126847a50 /widgets/msglist.go
parent60627c96f50a06483a57734c6b2a369ba84794ac (diff)
downloadaerc-8a42dfc87c61a393983ad6da895e74056f9b2fac.tar.gz
Show (no messages) for empty folders
Diffstat (limited to 'widgets/msglist.go')
-rw-r--r--widgets/msglist.go6
1 files changed, 6 insertions, 0 deletions
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()