From 67fb0938a66605a0b6a837005804637b348b250d Mon Sep 17 00:00:00 2001 From: Daniel Bridges Date: Mon, 22 Jul 2019 16:29:07 -0700 Subject: Support configurable header layout in compose widget --- config/config.go | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'config/config.go') diff --git a/config/config.go b/config/config.go index f863729..356d562 100644 --- a/config/config.go +++ b/config/config.go @@ -65,7 +65,8 @@ type BindingConfig struct { } type ComposeConfig struct { - Editor string `ini:"editor"` + Editor string `ini:"editor"` + HeaderLayout [][]string `ini:"-"` } type FilterConfig struct { @@ -278,6 +279,12 @@ func (config *AercConfig) LoadConfig(file *ini.File) error { if err := compose.MapTo(&config.Compose); err != nil { return err } + for key, val := range compose.KeysHash() { + switch key { + case "header-layout": + config.Compose.HeaderLayout = parseLayout(val) + } + } } if ui, err := file.GetSection("ui"); err == nil { if err := ui.MapTo(&config.Ui); err != nil { @@ -350,6 +357,13 @@ func LoadConfigFromFile(root *string, sharedir string) (*AercConfig, error) { {"Subject"}, }, }, + + Compose: ComposeConfig{ + HeaderLayout: [][]string{ + {"To", "From"}, + {"Subject"}, + }, + }, } // These bindings are not configurable config.Bindings.AccountWizard.ExKey = KeyStroke{ -- cgit 1.4.1-2-gfad0