diff options
author | Drew DeVault <sir@cmpwn.com> | 2019-05-14 15:25:30 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-05-14 15:25:30 -0400 |
commit | 065da5e37230976d85d163a6f682eddb9345aede (patch) | |
tree | 12bbbbdc95ad03d4e1a57b50350d372022a8b50d /config | |
parent | 9b2612eaf2fbe60a47ef9ca187a9fddb33705e92 (diff) | |
download | aerc-065da5e37230976d85d163a6f682eddb9345aede.tar.gz |
Add $EDITOR, internal config for compose
Diffstat (limited to 'config')
-rw-r--r-- | config/aerc.conf | 7 | ||||
-rw-r--r-- | config/config.go | 10 |
2 files changed, 17 insertions, 0 deletions
diff --git a/config/aerc.conf b/config/aerc.conf index 8b3ac3a7..12117641 100644 --- a/config/aerc.conf +++ b/config/aerc.conf @@ -57,6 +57,13 @@ pager=less -R # Default: text/plain,text/html alternatives=text/plain,text/html +[compose] +# +# Specifies the command to run the editor with. It will be shown in an embedded +# terminal, though it may also launch a graphical window if the environment +# supports it. Defaults to $EDITOR, or vi. +editor= + [filters] # # Filters allow you to pipe an email body through a shell command to render diff --git a/config/config.go b/config/config.go index 5c5094ab..8926fcd2 100644 --- a/config/config.go +++ b/config/config.go @@ -48,6 +48,10 @@ type BindingConfig struct { Terminal *KeyBindings } +type ComposeConfig struct { + Editor string `ini:"editor"` +} + type FilterConfig struct { FilterType int Filter string @@ -63,6 +67,7 @@ type ViewerConfig struct { type AercConfig struct { Bindings BindingConfig + Compose ComposeConfig Ini *ini.File `ini:"-"` Accounts []AccountConfig `ini:"-"` Filters []FilterConfig `ini:"-"` @@ -206,6 +211,11 @@ func LoadConfig(root *string) (*AercConfig, error) { } } } + if compose, err := file.GetSection("compose"); err == nil { + if err := compose.MapTo(&config.Compose); err != nil { + return nil, err + } + } if ui, err := file.GetSection("ui"); err == nil { if err := ui.MapTo(&config.Ui); err != nil { return nil, err |