aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config/aerc.conf.in5
-rw-r--r--config/config.go9
-rw-r--r--doc/aerc-config.5.scd5
-rw-r--r--widgets/msgviewer.go10
4 files changed, 21 insertions, 8 deletions
diff --git a/config/aerc.conf.in b/config/aerc.conf.in
index d490831e..42190423 100644
--- a/config/aerc.conf.in
+++ b/config/aerc.conf.in
@@ -69,6 +69,11 @@ show-headers=false
# Default: From|To,Cc|Bcc,Date,Subject
header-layout=From|To,Cc|Bcc,Date,Subject
+# Whether to always show the mimetype of an email, even when it is just a single part
+#
+# Default: false
+always-show-mime=false
+
[compose]
#
# Specifies the command to run the editor with. It will be shown in an embedded
diff --git a/config/config.go b/config/config.go
index 9e081fd8..6f3345d2 100644
--- a/config/config.go
+++ b/config/config.go
@@ -77,10 +77,11 @@ type FilterConfig struct {
}
type ViewerConfig struct {
- Pager string
- Alternatives []string
- ShowHeaders bool `ini:"show-headers"`
- HeaderLayout [][]string `ini:"-"`
+ Pager string
+ Alternatives []string
+ ShowHeaders bool `ini:"show-headers"`
+ AlwaysShowMime bool `ini:"always-show-mime"`
+ HeaderLayout [][]string `ini:"-"`
}
type AercConfig struct {
diff --git a/doc/aerc-config.5.scd b/doc/aerc-config.5.scd
index 3d39ef6e..665f4f4d 100644
--- a/doc/aerc-config.5.scd
+++ b/doc/aerc-config.5.scd
@@ -133,6 +133,11 @@ These options are configured in the *[viewer]* section of aerc.conf.
Default: false
+*always-show-mime*
+ Whether to always show the mimetype of an email, even when it is just a single part.
+
+ Default: false
+
## COMPOSE
These options are configured in the *[compose]* section of aerc.conf.
diff --git a/widgets/msgviewer.go b/widgets/msgviewer.go
index 1f0b0e49..3f9b7fee 100644
--- a/widgets/msgviewer.go
+++ b/widgets/msgviewer.go
@@ -38,9 +38,10 @@ type MessageViewer struct {
type PartSwitcher struct {
ui.Invalidatable
- parts []*PartViewer
- selected int
- showHeaders bool
+ parts []*PartViewer
+ selected int
+ showHeaders bool
+ alwaysShowMime bool
}
func NewMessageViewer(acct *AccountView, conf *config.AercConfig,
@@ -165,6 +166,7 @@ func createSwitcher(switcher *PartSwitcher, conf *config.AercConfig,
store *lib.MessageStore, msg *models.MessageInfo) error {
var err error
switcher.showHeaders = conf.Viewer.ShowHeaders
+ switcher.alwaysShowMime = conf.Viewer.AlwaysShowMime
if len(msg.BodyStructure.Parts) == 0 {
switcher.selected = 0
@@ -312,7 +314,7 @@ func (ps *PartSwitcher) Event(event tcell.Event) bool {
func (ps *PartSwitcher) Draw(ctx *ui.Context) {
height := len(ps.parts)
- if height == 1 {
+ if height == 1 && !ps.alwaysShowMime {
ps.parts[ps.selected].Draw(ctx)
return
}