From 598e4a5803578ab3e291f232d6aad31b4efd8ea4 Mon Sep 17 00:00:00 2001 From: Robin Jarry Date: Mon, 9 Oct 2023 13:52:20 +0200 Subject: 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 Acked-by: Moritz Poldrack --- main.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'main.go') diff --git a/main.go b/main.go index 0f897bd0..1210783f 100644 --- a/main.go +++ b/main.go @@ -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 { -- cgit