aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--commands/msg/delete.go2
-rw-r--r--config/aerc.conf.in5
-rw-r--r--config/config.go50
-rw-r--r--doc/aerc-config.5.scd5
4 files changed, 37 insertions, 25 deletions
diff --git a/commands/msg/delete.go b/commands/msg/delete.go
index 677ea63..8fefbd5 100644
--- a/commands/msg/delete.go
+++ b/commands/msg/delete.go
@@ -47,7 +47,7 @@ func (Delete) Execute(aerc *widgets.Aerc, args []string) error {
store.Next()
if isMsgView {
nextMsg := store.Selected()
- if nextMsg == msg {
+ if nextMsg == msg || !aerc.Config().Ui.NextMessageOnDelete {
aerc.RemoveTab(widget)
acct.Messages().Scroll()
} else {
diff --git a/config/aerc.conf.in b/config/aerc.conf.in
index 9ad7fcd..ec89ff7 100644
--- a/config/aerc.conf.in
+++ b/config/aerc.conf.in
@@ -57,6 +57,11 @@ dirlist-format=%n %>r
# Default: ""
sort=
+# Moves to next message when the current message is deleted
+#
+# Default: false
+next-message-on-delete=true
+
[viewer]
#
# Specifies the pager to use when displaying emails. Note that some filters
diff --git a/config/config.go b/config/config.go
index 5a41903..133a7f4 100644
--- a/config/config.go
+++ b/config/config.go
@@ -23,20 +23,21 @@ type GeneralConfig struct {
}
type UIConfig struct {
- IndexFormat string `ini:"index-format"`
- TimestampFormat string `ini:"timestamp-format"`
- ShowHeaders []string `delim:","`
- RenderAccountTabs string `ini:"render-account-tabs"`
- SidebarWidth int `ini:"sidebar-width"`
- PreviewHeight int `ini:"preview-height"`
- EmptyMessage string `ini:"empty-message"`
- EmptyDirlist string `ini:"empty-dirlist"`
- MouseEnabled bool `ini:"mouse-enabled"`
- NewMessageBell bool `ini:"new-message-bell"`
- Spinner string `ini:"spinner"`
- SpinnerDelimiter string `ini:"spinner-delimiter"`
- DirListFormat string `ini:"dirlist-format"`
- Sort []string `delim:" "`
+ IndexFormat string `ini:"index-format"`
+ TimestampFormat string `ini:"timestamp-format"`
+ ShowHeaders []string `delim:","`
+ RenderAccountTabs string `ini:"render-account-tabs"`
+ SidebarWidth int `ini:"sidebar-width"`
+ PreviewHeight int `ini:"preview-height"`
+ EmptyMessage string `ini:"empty-message"`
+ EmptyDirlist string `ini:"empty-dirlist"`
+ MouseEnabled bool `ini:"mouse-enabled"`
+ NewMessageBell bool `ini:"new-message-bell"`
+ Spinner string `ini:"spinner"`
+ SpinnerDelimiter string `ini:"spinner-delimiter"`
+ DirListFormat string `ini:"dirlist-format"`
+ Sort []string `delim:" "`
+ NextMessageOnDelete bool `ini:"next-message-on-delete"`
}
const (
@@ -346,16 +347,17 @@ func LoadConfigFromFile(root *string, sharedir string) (*AercConfig, error) {
ShowHeaders: []string{
"From", "To", "Cc", "Bcc", "Subject", "Date",
},
- RenderAccountTabs: "auto",
- SidebarWidth: 20,
- PreviewHeight: 12,
- EmptyMessage: "(no messages)",
- EmptyDirlist: "(no folders)",
- MouseEnabled: false,
- NewMessageBell: true,
- Spinner: "[..] , [..] , [..] , [..] , [..], [..] , [..] , [..] ",
- SpinnerDelimiter: ",",
- DirListFormat: "%n %>r",
+ RenderAccountTabs: "auto",
+ SidebarWidth: 20,
+ PreviewHeight: 12,
+ EmptyMessage: "(no messages)",
+ EmptyDirlist: "(no folders)",
+ MouseEnabled: false,
+ NewMessageBell: true,
+ Spinner: "[..] , [..] , [..] , [..] , [..], [..] , [..] , [..] ",
+ SpinnerDelimiter: ",",
+ DirListFormat: "%n %>r",
+ NextMessageOnDelete: true,
},
Viewer: ViewerConfig{
diff --git a/doc/aerc-config.5.scd b/doc/aerc-config.5.scd
index 67ab608..f4f02f2 100644
--- a/doc/aerc-config.5.scd
+++ b/doc/aerc-config.5.scd
@@ -150,6 +150,11 @@ These options are configured in the *[ui]* section of aerc.conf.
| %>X
: make format specifier 'X' be right justified
+*next-message-on-delete*
+ Moves to next message when the current message is deleted
+
+ Default: true
+
## VIEWER
These options are configured in the *[viewer]* section of aerc.conf.