diff options
author | Robin Jarry <robin@jarry.cc> | 2023-10-09 13:52:20 +0200 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2023-10-10 11:37:56 +0200 |
commit | 598e4a5803578ab3e291f232d6aad31b4efd8ea4 (patch) | |
tree | c55e16d60e2c3eea2d6de27d1bac18db5670ec77 /main.go | |
parent | 61bca76423ee87bd59084a146eca71c6bae085e1 (diff) | |
download | aerc-598e4a5803578ab3e291f232d6aad31b4efd8ea4.tar.gz |
widgets: rename package to app
This is the central point of all aerc. Having it named widgets is
confusing. Rename it to app. It will make a cleaner transition when
making the app.Aerc object available globally in the next commit.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Acked-by: Moritz Poldrack <moritz@poldrack.dev>
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -15,6 +15,7 @@ import ( "github.com/mattn/go-isatty" "github.com/xo/terminfo" + "git.sr.ht/~rjarry/aerc/app" "git.sr.ht/~rjarry/aerc/commands" "git.sr.ht/~rjarry/aerc/commands/account" "git.sr.ht/~rjarry/aerc/commands/compose" @@ -29,30 +30,29 @@ import ( libui "git.sr.ht/~rjarry/aerc/lib/ui" "git.sr.ht/~rjarry/aerc/log" "git.sr.ht/~rjarry/aerc/models" - "git.sr.ht/~rjarry/aerc/widgets" "git.sr.ht/~rjarry/aerc/worker/types" ) func getCommands(selected libui.Drawable) []*commands.Commands { switch selected.(type) { - case *widgets.AccountView: + case *app.AccountView: return []*commands.Commands{ account.AccountCommands, msg.MessageCommands, commands.GlobalCommands, } - case *widgets.Composer: + case *app.Composer: return []*commands.Commands{ compose.ComposeCommands, commands.GlobalCommands, } - case *widgets.MessageViewer: + case *app.MessageViewer: return []*commands.Commands{ msgview.MessageViewCommands, msg.MessageCommands, commands.GlobalCommands, } - case *widgets.Terminal: + case *app.Terminal: return []*commands.Commands{ terminal.TerminalCommands, commands.GlobalCommands, @@ -104,7 +104,7 @@ func expandAbbreviations(cmd []string, sets []*commands.Commands) []string { } func execCommand( - aerc *widgets.Aerc, ui *libui.UI, cmd []string, + aerc *app.Aerc, ui *libui.UI, cmd []string, acct *config.AccountConfig, msg *models.MessageInfo, ) error { cmds := getCommands(aerc.SelectedTabContent()) @@ -129,7 +129,7 @@ func execCommand( return nil } -func getCompletions(aerc *widgets.Aerc, cmd string) ([]string, string) { +func getCompletions(aerc *app.Aerc, cmd string) ([]string, string) { if options, prefix, ok := commands.GetTemplateCompletion(aerc, cmd); ok { return options, prefix } @@ -229,7 +229,7 @@ func main() { log.Infof("Starting up version %s", log.BuildInfo) var ( - aerc *widgets.Aerc + aerc *app.Aerc ui *libui.UI ) @@ -242,7 +242,7 @@ func main() { } defer c.Close() - aerc = widgets.NewAerc(c, func( + aerc = app.NewAerc(c, func( cmd []string, acct *config.AccountConfig, msg *models.MessageInfo, ) error { |