From d224487b6834aff5bb53f7042a142a7f3abe27b9 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Mon, 20 May 2019 17:03:37 -0400 Subject: Show attachment names in multipart view --- widgets/msgviewer.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'widgets') diff --git a/widgets/msgviewer.go b/widgets/msgviewer.go index 64762f7..e676478 100644 --- a/widgets/msgviewer.go +++ b/widgets/msgviewer.go @@ -255,9 +255,13 @@ func (ps *PartSwitcher) Draw(ctx *ui.Context) { for i, part := range ps.parts { style := tcell.StyleDefault.Reverse(ps.selected == i) ctx.Fill(0, y+i, ctx.Width(), 1, ' ', style) - ctx.Printf(len(part.index)*2, y+i, style, "%s/%s", + name := fmt.Sprintf("%s/%s", strings.ToLower(part.part.MIMEType), strings.ToLower(part.part.MIMESubType)) + if filename, ok := part.part.DispositionParams["filename"]; ok { + name += fmt.Sprintf(" (%s)", filename) + } + ctx.Printf(len(part.index)*2, y+i, style, "%s", name) } ps.parts[ps.selected].Draw(ctx.Subcontext( 0, 0, ctx.Width(), ctx.Height()-height)) -- cgit 1.4.1-2-gfad0 'sub right'>akspecs <akspecs@tilde.institute>
about summary refs log tree commit diff stats
path: root/examples/plugin_skip_default_rc.py
blob: 6a657a990ef0492d519514860f53d969a35bf903 (plain) (blame)
1
2
3
4
5
6
7
8
9