From 6811143925384ba1cfda8b3e1b338b0cfb9ac6e3 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Tue, 21 May 2019 16:31:04 -0400 Subject: New account wizard, part one --- config/config.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'config') diff --git a/config/config.go b/config/config.go index d885402..c6136cf 100644 --- a/config/config.go +++ b/config/config.go @@ -11,6 +11,7 @@ import ( "strings" "unicode" + "github.com/gdamore/tcell" "github.com/go-ini/ini" "github.com/kyoh86/xdg" ) @@ -45,6 +46,7 @@ type AccountConfig struct { type BindingConfig struct { Global *KeyBindings + AccountWizard *KeyBindings Compose *KeyBindings ComposeEditor *KeyBindings ComposeReview *KeyBindings @@ -208,6 +210,7 @@ func LoadConfig(root *string) (*AercConfig, error) { config := &AercConfig{ Bindings: BindingConfig{ Global: NewKeyBindings(), + AccountWizard: NewKeyBindings(), Compose: NewKeyBindings(), ComposeEditor: NewKeyBindings(), ComposeReview: NewKeyBindings(), @@ -229,6 +232,12 @@ func LoadConfig(root *string) (*AercConfig, error) { EmptyMessage: "(no messages)", }, } + // These bindings are not configurable + config.Bindings.AccountWizard.ExKey = KeyStroke{ + Key: tcell.KeyCtrlE, + } + quit, _ := ParseBinding("", ":quit") + config.Bindings.AccountWizard.Add(quit) if filters, err := file.GetSection("filters"); err == nil { // TODO: Parse the filter more finely, e.g. parse the regex for _, match := range filters.KeyStrings() { -- cgit v1.2.3