summary refs log tree commit diff stats
path: root/widgets/msglist.go
diff options
context:
space:
mode:
authorYash Srivastav <yash111998@gmail.com>2019-06-08 01:05:23 +0530
committerDrew DeVault <sir@cmpwn.com>2019-06-07 16:22:01 -0400
commitfca7321639f77bbf825dc897156d7a21993a2c69 (patch)
tree5e503bf4ebd9672eef2af5cbad49b5b73405e548 /widgets/msglist.go
parent6d491569c0f95bec03cc837446c2836acabe99ae (diff)
downloadaerc-fca7321639f77bbf825dc897156d7a21993a2c69.tar.gz
Message list: implement index-format option
Diffstat (limited to 'widgets/msglist.go')
-rw-r--r--widgets/msglist.go7
1 files changed, 6 insertions, 1 deletions
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
 	}