select next message when deleting from message viewer
This commit is contained in:
parent
c9a909fee3
commit
b72bb27cb4
|
@ -43,11 +43,18 @@ func (_ Delete) Execute(aerc *widgets.Aerc, args []string) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
_, isMsgView := widget.(*widgets.MessageViewer)
|
_, isMsgView := widget.(*widgets.MessageViewer)
|
||||||
if isMsgView {
|
mv, _ := aerc.SelectedTab().(*widgets.MessageViewer)
|
||||||
aerc.RemoveTab(widget)
|
|
||||||
}
|
|
||||||
store.Next()
|
store.Next()
|
||||||
|
if isMsgView {
|
||||||
|
nextMsg := store.Selected()
|
||||||
|
if nextMsg == msg {
|
||||||
|
aerc.RemoveTab(widget)
|
||||||
acct.Messages().Scroll()
|
acct.Messages().Scroll()
|
||||||
|
} else {
|
||||||
|
nextMv := widgets.NewMessageViewer(acct, aerc.Config(), store, nextMsg)
|
||||||
|
aerc.ReplaceTab(mv, nextMv, nextMsg.Envelope.Subject)
|
||||||
|
}
|
||||||
|
}
|
||||||
store.Delete([]uint32{msg.Uid}, func(msg types.WorkerMessage) {
|
store.Delete([]uint32{msg.Uid}, func(msg types.WorkerMessage) {
|
||||||
switch msg := msg.(type) {
|
switch msg := msg.(type) {
|
||||||
case *types.Done:
|
case *types.Done:
|
||||||
|
|
Loading…
Reference in New Issue