diff options
Diffstat (limited to 'config/config.go')
-rw-r--r-- | config/config.go | 41 |
1 files changed, 12 insertions, 29 deletions
diff --git a/config/config.go b/config/config.go index 0c2bf5f3..ef824279 100644 --- a/config/config.go +++ b/config/config.go @@ -16,12 +16,6 @@ import ( "git.sr.ht/~rjarry/aerc/logging" ) -type StatuslineConfig struct { - RenderFormat string `ini:"render-format"` - Separator string - DisplayMode string `ini:"display-mode"` -} - type TriggersConfig struct { NewEmail string `ini:"new-email"` ExecuteCommand func(command []string) error @@ -133,11 +127,6 @@ func (config *AercConfig) LoadConfig(file *ini.File) error { } } } - if statusline, err := file.GetSection("statusline"); err == nil { - if err := statusline.MapTo(&config.Statusline); err != nil { - return err - } - } if triggers, err := file.GetSection("triggers"); err == nil { if err := triggers.MapTo(&config.Triggers); err != nil { @@ -173,24 +162,16 @@ func LoadConfigFromFile(root *string, accts []string) (*AercConfig, error) { } file.NameMapper = mapName config := &AercConfig{ - Bindings: defaultBindsConfig(), - + Bindings: defaultBindsConfig(), ContextualBinds: []BindingConfigContext{}, - - General: defaultGeneralConfig(), - Ui: defaultUiConfig(), - ContextualUis: []UIConfigContext{}, - Viewer: defaultViewerConfig(), - - Statusline: StatuslineConfig{ - RenderFormat: "[%a] %S %>%T", - Separator: " | ", - DisplayMode: "", - }, - - Compose: defaultComposeConfig(), - Templates: defaultTemplatesConfig(), - Openers: make(map[string][]string), + General: defaultGeneralConfig(), + Ui: defaultUiConfig(), + ContextualUis: []UIConfigContext{}, + Viewer: defaultViewerConfig(), + Statusline: defaultStatuslineConfig(), + Compose: defaultComposeConfig(), + Templates: defaultTemplatesConfig(), + Openers: make(map[string][]string), } if err := config.parseFilters(file); err != nil { @@ -202,6 +183,9 @@ func LoadConfigFromFile(root *string, accts []string) (*AercConfig, error) { if err := config.parseViewer(file); err != nil { return nil, err } + if err := config.parseStatusline(file); err != nil { + return nil, err + } if err = config.LoadConfig(file); err != nil { return nil, err } @@ -212,7 +196,6 @@ func LoadConfigFromFile(root *string, accts []string) (*AercConfig, error) { return nil, err } - logging.Debugf("aerc.conf: [statusline] %#v", config.Statusline) logging.Debugf("aerc.conf: [openers] %#v", config.Openers) logging.Debugf("aerc.conf: [triggers] %#v", config.Triggers) |