aboutsummaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
authorRobin Jarry <robin@jarry.cc>2022-07-18 12:54:55 +0200
committerRobin Jarry <robin@jarry.cc>2022-07-23 22:00:21 +0200
commitc841f36513ffdaffbf4b68e5f108c97a45745092 (patch)
treee339d287ba01f8a4b1e99c721d841015bb729317 /commands
parentc49a065496ed232399b31506031711d4c1f802e0 (diff)
downloadaerc-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')
-rw-r--r--commands/compose/abort.go2
-rw-r--r--commands/compose/attach-key.go2
-rw-r--r--commands/compose/attach.go2
-rw-r--r--commands/compose/cc-bcc.go2
-rw-r--r--commands/compose/detach.go4
-rw-r--r--commands/compose/edit.go2
-rw-r--r--commands/compose/encrypt.go2
-rw-r--r--commands/compose/header.go2
-rw-r--r--commands/compose/next-field.go2
-rw-r--r--commands/compose/postpone.go2
-rw-r--r--commands/compose/send.go2
-rw-r--r--commands/compose/sign.go2
-rw-r--r--commands/exec.go2
-rw-r--r--commands/msg/forward.go2
-rw-r--r--commands/msg/pipe.go2
-rw-r--r--commands/msg/recall.go2
-rw-r--r--commands/msg/reply.go2
-rw-r--r--commands/msg/unsubscribe.go4
-rw-r--r--commands/msg/utils.go2
-rw-r--r--commands/msgview/close.go2
-rw-r--r--commands/msgview/next-part.go2
-rw-r--r--commands/msgview/next.go2
-rw-r--r--commands/msgview/open.go4
-rw-r--r--commands/msgview/save.go4
-rw-r--r--commands/msgview/toggle-headers.go2
-rw-r--r--commands/msgview/toggle-key-passthrough.go2
-rw-r--r--commands/terminal/close.go2
27 files changed, 31 insertions, 31 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 {
diff --git a/commands/exec.go b/commands/exec.go
index bce62bd7..8757a51a 100644
--- a/commands/exec.go
+++ b/commands/exec.go
@@ -33,7 +33,7 @@ func (ExecCmd) Execute(aerc *widgets.Aerc, args []string) error {
cmd := exec.Command(args[1], args[2:]...)
env := os.Environ()
- switch view := aerc.SelectedTab().(type) {
+ switch view := aerc.SelectedTabContent().(type) {
case *widgets.AccountView:
env = append(env, fmt.Sprintf("account=%s", view.AccountConfig().Name))
env = append(env, fmt.Sprintf("folder=%s", view.Directories().Selected()))
diff --git a/commands/msg/forward.go b/commands/msg/forward.go
index 8fc34aa7..ad80fea3 100644
--- a/commands/msg/forward.go
+++ b/commands/msg/forward.go
@@ -60,7 +60,7 @@ func (forward) Execute(aerc *widgets.Aerc, args []string) error {
return errors.New("Options -A and -F are mutually exclusive")
}
- widget := aerc.SelectedTab().(widgets.ProvidesMessage)
+ widget := aerc.SelectedTabContent().(widgets.ProvidesMessage)
acct := widget.SelectedAccount()
if acct == nil {
return errors.New("No account selected")
diff --git a/commands/msg/pipe.go b/commands/msg/pipe.go
index cab109e0..35ee05bc 100644
--- a/commands/msg/pipe.go
+++ b/commands/msg/pipe.go
@@ -63,7 +63,7 @@ func (Pipe) Execute(aerc *widgets.Aerc, args []string) error {
return errors.New("Usage: pipe [-mp] <cmd> [args...]")
}
- provider := aerc.SelectedTab().(widgets.ProvidesMessage)
+ provider := aerc.SelectedTabContent().(widgets.ProvidesMessage)
if !pipeFull && !pipePart {
if _, ok := provider.(*widgets.MessageViewer); ok {
pipePart = true
diff --git a/commands/msg/recall.go b/commands/msg/recall.go
index b59372a6..3c9f0f2d 100644
--- a/commands/msg/recall.go
+++ b/commands/msg/recall.go
@@ -51,7 +51,7 @@ func (Recall) Execute(aerc *widgets.Aerc, args []string) error {
return errors.New("Usage: recall [-f]")
}
- widget := aerc.SelectedTab().(widgets.ProvidesMessage)
+ widget := aerc.SelectedTabContent().(widgets.ProvidesMessage)
acct := widget.SelectedAccount()
if acct == nil {
return errors.New("No account selected")
diff --git a/commands/msg/reply.go b/commands/msg/reply.go
index 30b09b62..a1254a12 100644
--- a/commands/msg/reply.go
+++ b/commands/msg/reply.go
@@ -55,7 +55,7 @@ func (reply) Execute(aerc *widgets.Aerc, args []string) error {
}
}
- widget := aerc.SelectedTab().(widgets.ProvidesMessage)
+ widget := aerc.SelectedTabContent().(widgets.ProvidesMessage)
acct := widget.SelectedAccount()
if acct == nil {
diff --git a/commands/msg/unsubscribe.go b/commands/msg/unsubscribe.go
index ed6ad4f7..126a23db 100644
--- a/commands/msg/unsubscribe.go
+++ b/commands/msg/unsubscribe.go
@@ -37,7 +37,7 @@ func (Unsubscribe) Execute(aerc *widgets.Aerc, args []string) error {
if len(args) != 1 {
return errors.New("Usage: unsubscribe")
}
- widget := aerc.SelectedTab().(widgets.ProvidesMessage)
+ widget := aerc.SelectedTabContent().(widgets.ProvidesMessage)
msg, err := widget.SelectedMessage()
if err != nil {
return err
@@ -135,7 +135,7 @@ func parseUnsubscribeMethods(header string) (methods []*url.URL) {
}
func unsubscribeMailto(aerc *widgets.Aerc, u *url.URL) error {
- widget := aerc.SelectedTab().(widgets.ProvidesMessage)
+ widget := aerc.SelectedTabContent().(widgets.ProvidesMessage)
acct := widget.SelectedAccount()
if acct == nil {
return errors.New("No account selected")
diff --git a/commands/msg/utils.go b/commands/msg/utils.go
index 212fc75a..4ce82a74 100644
--- a/commands/msg/utils.go
+++ b/commands/msg/utils.go
@@ -14,7 +14,7 @@ type helper struct {
}
func newHelper(aerc *widgets.Aerc) *helper {
- return &helper{aerc.SelectedTab().(widgets.ProvidesMessages)}
+ return &helper{aerc.SelectedTabContent().(widgets.ProvidesMessages)}
}
func (h *helper) markedOrSelectedUids() ([]uint32, error) {
diff --git a/commands/msgview/close.go b/commands/msgview/close.go
index 37f66ad3..1fed0b7c 100644
--- a/commands/msgview/close.go
+++ b/commands/msgview/close.go
@@ -24,7 +24,7 @@ func (Close) Execute(aerc *widgets.Aerc, args []string) error {
if len(args) != 1 {
return errors.New("Usage: close")
}
- mv, _ := aerc.SelectedTab().(*widgets.MessageViewer)
+ mv, _ := aerc.SelectedTabContent().(*widgets.MessageViewer)
mv.Close()
aerc.RemoveTab(mv)
return nil
diff --git a/commands/msgview/next-part.go b/commands/msgview/next-part.go
index f44ffabf..652dccb6 100644
--- a/commands/msgview/next-part.go
+++ b/commands/msgview/next-part.go
@@ -35,7 +35,7 @@ func (NextPrevPart) Execute(aerc *widgets.Aerc, args []string) error {
return nextPrevPartUsage(args[0])
}
}
- mv, _ := aerc.SelectedTab().(*widgets.MessageViewer)
+ mv, _ := aerc.SelectedTabContent().(*widgets.MessageViewer)
for ; n > 0; n-- {
if args[0] == "prev-part" {
mv.PreviousPart()
diff --git a/commands/msgview/next.go b/commands/msgview/next.go
index 928b9fbc..c80e0ab6 100644
--- a/commands/msgview/next.go
+++ b/commands/msgview/next.go
@@ -27,7 +27,7 @@ func (NextPrevMsg) Execute(aerc *widgets.Aerc, args []string) error {
if err != nil {
return err
}
- mv, _ := aerc.SelectedTab().(*widgets.MessageViewer)
+ mv, _ := aerc.SelectedTabContent().(*widgets.MessageViewer)
acct := mv.SelectedAccount()
if acct == nil {
return errors.New("No account selected")
diff --git a/commands/msgview/open.go b/commands/msgview/open.go
index 7615e9a8..05a3c63c 100644
--- a/commands/msgview/open.go
+++ b/commands/msgview/open.go
@@ -25,7 +25,7 @@ func (Open) Aliases() []string {
}
func (Open) Complete(aerc *widgets.Aerc, args []string) []string {
- mv := aerc.SelectedTab().(*widgets.MessageViewer)
+ mv := aerc.SelectedTabContent().(*widgets.MessageViewer)
if mv != nil {
if p := mv.SelectedMessagePart(); p != nil {
return commands.CompletionFromList(aerc, p.Links, args)
@@ -35,7 +35,7 @@ func (Open) Complete(aerc *widgets.Aerc, args []string) []string {
}
func (Open) Execute(aerc *widgets.Aerc, args []string) error {
- mv := aerc.SelectedTab().(*widgets.MessageViewer)
+ mv := aerc.SelectedTabContent().(*widgets.MessageViewer)
p := mv.SelectedMessagePart()
if args[0] == "open-link" && len(args) > 1 {
diff --git a/commands/msgview/save.go b/commands/msgview/save.go
index 8aedd428..f27a68c6 100644
--- a/commands/msgview/save.go
+++ b/commands/msgview/save.go
@@ -99,9 +99,9 @@ func (Save) Execute(aerc *widgets.Aerc, args []string) error {
return err
}
- mv, ok := aerc.SelectedTab().(*widgets.MessageViewer)
+ mv, ok := aerc.SelectedTabContent().(*widgets.MessageViewer)
if !ok {
- return fmt.Errorf("SelectedTab is not a MessageViewer")
+ return fmt.Errorf("SelectedTabContent is not a MessageViewer")
}
if params.attachments {
diff --git a/commands/msgview/toggle-headers.go b/commands/msgview/toggle-headers.go
index 75f7e462..1a593494 100644
--- a/commands/msgview/toggle-headers.go
+++ b/commands/msgview/toggle-headers.go
@@ -24,7 +24,7 @@ func (ToggleHeaders) Execute(aerc *widgets.Aerc, args []string) error {
if len(args) > 1 {
return toggleHeadersUsage(args[0])
}
- mv, _ := aerc.SelectedTab().(*widgets.MessageViewer)
+ mv, _ := aerc.SelectedTabContent().(*widgets.MessageViewer)
mv.ToggleHeaders()
return nil
}
diff --git a/commands/msgview/toggle-key-passthrough.go b/commands/msgview/toggle-key-passthrough.go
index 1ac370e6..cbc4565e 100644
--- a/commands/msgview/toggle-key-passthrough.go
+++ b/commands/msgview/toggle-key-passthrough.go
@@ -25,7 +25,7 @@ func (ToggleKeyPassthrough) Execute(aerc *widgets.Aerc, args []string) error {
if len(args) != 1 {
return errors.New("Usage: toggle-key-passthrough")
}
- mv, _ := aerc.SelectedTab().(*widgets.MessageViewer)
+ mv, _ := aerc.SelectedTabContent().(*widgets.MessageViewer)
keyPassthroughEnabled := mv.ToggleKeyPassthrough()
if acct := mv.SelectedAccount(); acct != nil {
acct.SetStatus(statusline.Passthrough(keyPassthroughEnabled))
diff --git a/commands/terminal/close.go b/commands/terminal/close.go
index 95ee94c6..1698e930 100644
--- a/commands/terminal/close.go
+++ b/commands/terminal/close.go
@@ -24,7 +24,7 @@ func (Close) Execute(aerc *widgets.Aerc, args []string) error {
if len(args) != 1 {
return errors.New("Usage: close")
}
- term, _ := aerc.SelectedTab().(*widgets.Terminal)
+ term, _ := aerc.SelectedTabContent().(*widgets.Terminal)
term.Close(nil)
return nil
}