aboutsummaryrefslogtreecommitdiffstats
path: root/commands/compose
diff options
context:
space:
mode:
authorRobin Jarry <robin@jarry.cc>2023-03-15 20:38:37 +0100
committerRobin Jarry <robin@jarry.cc>2023-04-01 01:01:07 +0200
commit088d63ce934c34e113a5b3154dfcf91b49132067 (patch)
treea743b7f5f563d7382ebde83cac5ba498b3f6b1e7 /commands/compose
parentaec90650f63ff0195599dae817016db137964bcb (diff)
downloadaerc-088d63ce934c34e113a5b3154dfcf91b49132067.tar.gz
tabs: make sure to close tab content
Rework how tabs are closed. Change the aerc.RemoveTab and aerc.ReplaceTab functions to accept a new boolean argument. If true, make sure to close the tab content. Signed-off-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'commands/compose')
-rw-r--r--commands/compose/abort.go3
-rw-r--r--commands/compose/postpone.go2
-rw-r--r--commands/compose/send.go2
3 files changed, 3 insertions, 4 deletions
diff --git a/commands/compose/abort.go b/commands/compose/abort.go
index 44711eb3..d6a81b57 100644
--- a/commands/compose/abort.go
+++ b/commands/compose/abort.go
@@ -26,8 +26,7 @@ func (Abort) Execute(aerc *widgets.Aerc, args []string) error {
}
composer, _ := aerc.SelectedTabContent().(*widgets.Composer)
- aerc.RemoveTab(composer)
- composer.Close()
+ aerc.RemoveTab(composer, true)
return nil
}
diff --git a/commands/compose/postpone.go b/commands/compose/postpone.go
index cc709ff7..dad76877 100644
--- a/commands/compose/postpone.go
+++ b/commands/compose/postpone.go
@@ -84,7 +84,7 @@ func (Postpone) Execute(aerc *widgets.Aerc, args []string) error {
aerc.NewTab(composer, tabName)
}
- aerc.RemoveTab(composer)
+ aerc.RemoveTab(composer, false)
var buf bytes.Buffer
ctr := datacounter.NewWriterCounter(&buf)
err = composer.WriteMessage(header, ctr)
diff --git a/commands/compose/send.go b/commands/compose/send.go
index a5571e37..d43f28ea 100644
--- a/commands/compose/send.go
+++ b/commands/compose/send.go
@@ -145,7 +145,7 @@ func send(aerc *widgets.Aerc, composer *widgets.Composer, ctx sendCtx,
) {
// we don't want to block the UI thread while we are sending
// so we do everything in a goroutine and hide the composer from the user
- aerc.RemoveTab(composer)
+ aerc.RemoveTab(composer, false)
aerc.PushStatus("Sending...", 10*time.Second)
log.Debugf("send uri: %s", ctx.uri.String())