aboutsummaryrefslogtreecommitdiff
path: root/commands
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2019-03-30 14:12:04 -0400
committerDrew DeVault <sir@cmpwn.com>2019-03-30 14:12:04 -0400
commitfa04a1e036a418258451466d99de34a9546a9965 (patch)
treeec409d99e9a306488c6ffb9b71683e171a2ec007 /commands
parent2958579ee75359dacfabb6d1b36664468011113c (diff)
Add basic message viewer mockup
Diffstat (limited to 'commands')
-rw-r--r--commands/account/pipe.go3
-rw-r--r--commands/term.go5
-rw-r--r--commands/terminal/close.go6
3 files changed, 6 insertions, 8 deletions
diff --git a/commands/account/pipe.go b/commands/account/pipe.go
index ab2518b..60ac793 100644
--- a/commands/account/pipe.go
+++ b/commands/account/pipe.go
@@ -41,12 +41,11 @@ func Pipe(aerc *widgets.Aerc, args []string) error {
Color(tcell.ColorDefault, tcell.ColorRed)
return
}
- host := widgets.NewTermHost(term, aerc.Config())
name := msg.Subject()
if len(name) > 12 {
name = name[:12]
}
- aerc.NewTab(host, args[1] + " <" + name)
+ aerc.NewTab(term, args[1] + " <" + name)
term.OnClose = func(err error) {
if err != nil {
aerc.PushStatus(" "+err.Error(), 10*time.Second).
diff --git a/commands/term.go b/commands/term.go
index aea6382..91ffebd 100644
--- a/commands/term.go
+++ b/commands/term.go
@@ -26,8 +26,7 @@ func Term(aerc *widgets.Aerc, args []string) error {
if err != nil {
return err
}
- host := widgets.NewTermHost(term, aerc.Config())
- tab := aerc.NewTab(host, args[1])
+ tab := aerc.NewTab(term, args[1])
term.OnTitle = func(title string) {
if title == "" {
title = args[1]
@@ -36,7 +35,7 @@ func Term(aerc *widgets.Aerc, args []string) error {
tab.Content.Invalidate()
}
term.OnClose = func(err error) {
- aerc.RemoveTab(host)
+ aerc.RemoveTab(term)
if err != nil {
aerc.PushStatus(" "+err.Error(), 10*time.Second).
Color(tcell.ColorDefault, tcell.ColorRed)
diff --git a/commands/terminal/close.go b/commands/terminal/close.go
index cb5702e..0a9d100 100644
--- a/commands/terminal/close.go
+++ b/commands/terminal/close.go
@@ -14,11 +14,11 @@ func CommandClose(aerc *widgets.Aerc, args []string) error {
if len(args) != 1 {
return errors.New("Usage: close")
}
- thost, ok := aerc.SelectedTab().(*widgets.TermHost)
+ term, ok := aerc.SelectedTab().(*widgets.Terminal)
if !ok {
return errors.New("Error: not a terminal")
}
- thost.Terminal().Close(nil)
- aerc.RemoveTab(thost)
+ term.Close(nil)
+ aerc.RemoveTab(term)
return nil
}