From fca7321639f77bbf825dc897156d7a21993a2c69 Mon Sep 17 00:00:00 2001 From: Yash Srivastav Date: Sat, 8 Jun 2019 01:05:23 +0530 Subject: Message list: implement index-format option --- widgets/msglist.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'widgets/msglist.go') diff --git a/widgets/msglist.go b/widgets/msglist.go index caa868f..f1cbb31 100644 --- a/widgets/msglist.go +++ b/widgets/msglist.go @@ -80,7 +80,12 @@ func (ml *MessageList) Draw(ctx *ui.Context) { style = style.Foreground(tcell.ColorGray) } ctx.Fill(0, row, ctx.Width(), 1, ' ', style) - ctx.Printf(0, row, style, "%s", msg.Envelope.Subject) + fmtStr, args, err := lib.ParseIndexFormat(ml.conf, i, msg) + if err != nil { + ctx.Printf(0, row, style, "%v", err) + } else { + ctx.Printf(0, row, style, fmtStr, args...) + } row += 1 } -- cgit v1.2.3