A minimal email TUI where you read with Markdown and write in Neovim. neomd.ssp.sh/docs
email markdown neovim tui
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix showing recipient in SENT tab (instead of from)

sspaeti 8b218805 96d76f60

+12 -5
+11 -4
internal/ui/inbox.go
··· 27 27 func (e emailItem) Description() string { return e.email.From } 28 28 29 29 // emailDelegate is a custom list.ItemDelegate that renders one email per row. 30 - type emailDelegate struct{} 30 + type emailDelegate struct { 31 + sentFolder string // when active folder matches, show To instead of From 32 + } 31 33 32 34 func (d emailDelegate) Height() int { return 1 } 33 35 func (d emailDelegate) Spacing() int { return 0 } ··· 82 84 subjectMax = 8 83 85 } 84 86 85 - from := truncate(cleanFrom(e.email.From), fromMax) 87 + sender := e.email.From 88 + if d.sentFolder != "" && e.email.Folder == d.sentFolder { 89 + sender = "→ " + e.email.To // show recipient in Sent 90 + } 91 + from := truncate(cleanFrom(sender), fromMax) 86 92 subject := truncate(e.email.Subject, subjectMax) 87 93 88 94 if isSelected { ··· 176 182 } 177 183 178 184 // newInboxList creates a bubbles/list configured for the email inbox. 179 - func newInboxList(width, height int) list.Model { 180 - l := list.New(nil, emailDelegate{}, width, height) 185 + // sentFolder is the IMAP folder name for Sent mail — used to show To instead of From. 186 + func newInboxList(width, height int, sentFolder string) list.Model { 187 + l := list.New(nil, emailDelegate{sentFolder: sentFolder}, width, height) 181 188 l.SetShowTitle(false) 182 189 l.SetShowStatusBar(false) 183 190 l.SetShowHelp(false)
+1 -1
internal/ui/model.go
··· 840 840 listH = 5 841 841 } 842 842 if m.inbox.Width() == 0 { 843 - m.inbox = newInboxList(msg.Width, listH) 843 + m.inbox = newInboxList(msg.Width, listH, m.cfg.Folders.Sent) 844 844 } else { 845 845 m.inbox.SetSize(msg.Width, listH) 846 846 }