diff options
author | Robin Jarry <robin@jarry.cc> | 2022-07-18 12:54:55 +0200 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-07-23 22:00:21 +0200 |
commit | c841f36513ffdaffbf4b68e5f108c97a45745092 (patch) | |
tree | e339d287ba01f8a4b1e99c721d841015bb729317 /commands/compose | |
parent | c49a065496ed232399b31506031711d4c1f802e0 (diff) | |
download | aerc-c841f36513ffdaffbf4b68e5f108c97a45745092.tar.gz |
tabs: rename SelectedTab to SelectedTabContent
This function returns an ui.Drawable. Use a more explicit name. This
prepares for adding a new SelectedTab function which will return
an ui.Tab.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Acked-by: Koni Marti <koni.marti@gmail.com>
Diffstat (limited to 'commands/compose')
-rw-r--r-- | commands/compose/abort.go | 2 | ||||
-rw-r--r-- | commands/compose/attach-key.go | 2 | ||||
-rw-r--r-- | commands/compose/attach.go | 2 | ||||
-rw-r--r-- | commands/compose/cc-bcc.go | 2 | ||||
-rw-r--r-- | commands/compose/detach.go | 4 | ||||
-rw-r--r-- | commands/compose/edit.go | 2 | ||||
-rw-r--r-- | commands/compose/encrypt.go | 2 | ||||
-rw-r--r-- | commands/compose/header.go | 2 | ||||
-rw-r--r-- | commands/compose/next-field.go | 2 | ||||
-rw-r--r-- | commands/compose/postpone.go | 2 | ||||
-rw-r--r-- | commands/compose/send.go | 2 | ||||
-rw-r--r-- | commands/compose/sign.go | 2 |
12 files changed, 13 insertions, 13 deletions
diff --git a/commands/compose/abort.go b/commands/compose/abort.go index d4a4699e..44711eb3 100644 --- a/commands/compose/abort.go +++ b/commands/compose/abort.go @@ -24,7 +24,7 @@ func (Abort) Execute(aerc *widgets.Aerc, args []string) error { if len(args) != 1 { return errors.New("Usage: abort") } - composer, _ := aerc.SelectedTab().(*widgets.Composer) + composer, _ := aerc.SelectedTabContent().(*widgets.Composer) aerc.RemoveTab(composer) composer.Close() diff --git a/commands/compose/attach-key.go b/commands/compose/attach-key.go index c9212e3d..208e9fd8 100644 --- a/commands/compose/attach-key.go +++ b/commands/compose/attach-key.go @@ -25,7 +25,7 @@ func (AttachKey) Execute(aerc *widgets.Aerc, args []string) error { return errors.New("Usage: attach-key") } - composer, _ := aerc.SelectedTab().(*widgets.Composer) + composer, _ := aerc.SelectedTabContent().(*widgets.Composer) return composer.SetAttachKey(!composer.AttachKey()) } diff --git a/commands/compose/attach.go b/commands/compose/attach.go index 50abda5f..60809736 100644 --- a/commands/compose/attach.go +++ b/commands/compose/attach.go @@ -47,7 +47,7 @@ func (Attach) Execute(aerc *widgets.Aerc, args []string) error { return nil } - composer, _ := aerc.SelectedTab().(*widgets.Composer) + composer, _ := aerc.SelectedTabContent().(*widgets.Composer) composer.AddAttachment(path) aerc.PushSuccess(fmt.Sprintf("Attached %s", pathinfo.Name())) diff --git a/commands/compose/cc-bcc.go b/commands/compose/cc-bcc.go index 5540f838..17e925e1 100644 --- a/commands/compose/cc-bcc.go +++ b/commands/compose/cc-bcc.go @@ -25,7 +25,7 @@ func (CC) Execute(aerc *widgets.Aerc, args []string) error { if len(args) > 1 { addrs = strings.Join(args[1:], " ") } - composer, _ := aerc.SelectedTab().(*widgets.Composer) + composer, _ := aerc.SelectedTabContent().(*widgets.Composer) switch args[0] { case "cc": diff --git a/commands/compose/detach.go b/commands/compose/detach.go index 31ac082a..487bf225 100644 --- a/commands/compose/detach.go +++ b/commands/compose/detach.go @@ -18,13 +18,13 @@ func (Detach) Aliases() []string { } func (Detach) Complete(aerc *widgets.Aerc, args []string) []string { - composer, _ := aerc.SelectedTab().(*widgets.Composer) + composer, _ := aerc.SelectedTabContent().(*widgets.Composer) return composer.GetAttachments() } func (Detach) Execute(aerc *widgets.Aerc, args []string) error { var path string - composer, _ := aerc.SelectedTab().(*widgets.Composer) + composer, _ := aerc.SelectedTabContent().(*widgets.Composer) if len(args) > 1 { path = strings.Join(args[1:], " ") diff --git a/commands/compose/edit.go b/commands/compose/edit.go index 375f3619..7a61f77a 100644 --- a/commands/compose/edit.go +++ b/commands/compose/edit.go @@ -24,7 +24,7 @@ func (Edit) Execute(aerc *widgets.Aerc, args []string) error { if len(args) != 1 { return errors.New("Usage: edit") } - composer, _ := aerc.SelectedTab().(*widgets.Composer) + composer, _ := aerc.SelectedTabContent().(*widgets.Composer) composer.ShowTerminal() composer.FocusTerminal() return nil diff --git a/commands/compose/encrypt.go b/commands/compose/encrypt.go index 3bd8ca42..905bdc4b 100644 --- a/commands/compose/encrypt.go +++ b/commands/compose/encrypt.go @@ -25,7 +25,7 @@ func (Encrypt) Execute(aerc *widgets.Aerc, args []string) error { return errors.New("Usage: encrypt") } - composer, _ := aerc.SelectedTab().(*widgets.Composer) + composer, _ := aerc.SelectedTabContent().(*widgets.Composer) composer.SetEncrypt(!composer.Encrypt()) return nil diff --git a/commands/compose/header.go b/commands/compose/header.go index fc0a81b2..ca5c8698 100644 --- a/commands/compose/header.go +++ b/commands/compose/header.go @@ -60,7 +60,7 @@ func (Header) Execute(aerc *widgets.Aerc, args []string) error { } } - composer, _ := aerc.SelectedTab().(*widgets.Composer) + composer, _ := aerc.SelectedTabContent().(*widgets.Composer) args[optind] = strings.TrimRight(args[optind], ":") diff --git a/commands/compose/next-field.go b/commands/compose/next-field.go index 69b33e55..ec4db582 100644 --- a/commands/compose/next-field.go +++ b/commands/compose/next-field.go @@ -24,7 +24,7 @@ func (NextPrevField) Execute(aerc *widgets.Aerc, args []string) error { if len(args) > 2 { return nextPrevFieldUsage(args[0]) } - composer, _ := aerc.SelectedTab().(*widgets.Composer) + composer, _ := aerc.SelectedTabContent().(*widgets.Composer) if args[0] == "prev-field" { composer.PrevField() } else { diff --git a/commands/compose/postpone.go b/commands/compose/postpone.go index f826f681..e1c0568b 100644 --- a/commands/compose/postpone.go +++ b/commands/compose/postpone.go @@ -35,7 +35,7 @@ func (Postpone) Execute(aerc *widgets.Aerc, args []string) error { if acct == nil { return errors.New("No account selected") } - composer, _ := aerc.SelectedTab().(*widgets.Composer) + composer, _ := aerc.SelectedTabContent().(*widgets.Composer) config := composer.Config() tabName := aerc.TabNames()[aerc.SelectedTabIndex()] diff --git a/commands/compose/send.go b/commands/compose/send.go index dd3a8d34..776779e6 100644 --- a/commands/compose/send.go +++ b/commands/compose/send.go @@ -43,7 +43,7 @@ func (Send) Execute(aerc *widgets.Aerc, args []string) error { if len(args) > 1 { return errors.New("Usage: send") } - composer, _ := aerc.SelectedTab().(*widgets.Composer) + composer, _ := aerc.SelectedTabContent().(*widgets.Composer) tabName := aerc.TabNames()[aerc.SelectedTabIndex()] config := composer.Config() diff --git a/commands/compose/sign.go b/commands/compose/sign.go index 635b07c6..e6afd98e 100644 --- a/commands/compose/sign.go +++ b/commands/compose/sign.go @@ -26,7 +26,7 @@ func (Sign) Execute(aerc *widgets.Aerc, args []string) error { return errors.New("Usage: sign") } - composer, _ := aerc.SelectedTab().(*widgets.Composer) + composer, _ := aerc.SelectedTabContent().(*widgets.Composer) err := composer.SetSign(!composer.Sign()) if err != nil { |