summary refs log tree commit diff stats
path: root/config
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2019-03-15 20:40:28 -0400
committerDrew DeVault <sir@cmpwn.com>2019-03-15 20:40:28 -0400
commita729179f9fae4a89a0b65984263a7893fcab874a (patch)
treeed7dc46f8f1469513805d13a160fece944484637 /config
parentf406bf5a3bb953426a00f2feac1f2863a29ab269 (diff)
downloadaerc-a729179f9fae4a89a0b65984263a7893fcab874a.tar.gz
Implement sidebar-width config option
Diffstat (limited to 'config')
-rw-r--r--config/config.go17
1 files changed, 10 insertions, 7 deletions
diff --git a/config/config.go b/config/config.go
index ff0e094..173d4af 100644
--- a/config/config.go
+++ b/config/config.go
@@ -11,14 +11,14 @@ import (
 )
 
 type UIConfig struct {
-	IndexFormat       string
-	TimestampFormat   string
+	IndexFormat       string   `ini:"index-format"`
+	TimestampFormat   string   `ini:"timestamp-format"`
 	ShowHeaders       []string `delim:","`
 	LoadingFrames     []string `delim:","`
-	RenderAccountTabs string
-	SidebarWidth      int
-	PreviewHeight     int
-	EmptyMessage      string
+	RenderAccountTabs string   `ini:"render-account-tabs"`
+	SidebarWidth      int      `ini:"sidebar-width"`
+	PreviewHeight     int      `ini:"preview-height"`
+	EmptyMessage      string   `ini:"empty-message"`
 }
 
 type AccountConfig struct {
@@ -114,7 +114,10 @@ func LoadConfig(root *string) (*AercConfig, error) {
 		},
 	}
 	if ui, err := file.GetSection("ui"); err == nil {
-		ui.MapTo(config.Ui)
+		if err := ui.MapTo(&config.Ui); err != nil {
+			return nil, err
+		}
+		fmt.Printf("%v\n", config.Ui)
 	}
 	if lbinds, err := file.GetSection("lbinds"); err == nil {
 		for key, value := range lbinds.KeysHash() {