about summary refs log tree commit diff stats
path: root/commands/msg/delete.go
diff options
context:
space:
mode:
authorJeffas <dev@jeffas.io>2020-06-09 20:13:13 +0100
committerReto Brunner <reto@labrat.space>2020-06-09 21:52:10 +0200
commit15b72df1dabb6675c20cff043648e97a209d2132 (patch)
tree184b15a40d8aa242259f4ee46caebc51527f5e26 /commands/msg/delete.go
parentc6f4d7badd4cb36067f0e76198630a3d0f9e7ce9 (diff)
downloadaerc-15b72df1dabb6675c20cff043648e97a209d2132.tar.gz
Rework msglist scrolling
This changes the scrolling to be done on the draw, when the height is
updated, ensuring that the selected item is kept on screen during
resizing.

Also, this ensures that messages will fill the screen when resizing the
window, for instance, shrinking and then growing drags down more
messages if possible.

This is a transplant of the dirlist scrolling logic.
Diffstat (limited to 'commands/msg/delete.go')
-rw-r--r--commands/msg/delete.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/commands/msg/delete.go b/commands/msg/delete.go
index 4bda8b9..e74bf10 100644
--- a/commands/msg/delete.go
+++ b/commands/msg/delete.go
@@ -62,7 +62,7 @@ func (Delete) Execute(aerc *widgets.Aerc, args []string) error {
 			// no more messages in the list
 			if next == nil {
 				aerc.RemoveTab(h.msgProvider)
-				acct.Messages().Scroll()
+				acct.Messages().Invalidate()
 				return nil
 			}
 			lib.NewMessageStoreView(next, store, aerc.DecryptKeys,
@@ -76,7 +76,7 @@ func (Delete) Execute(aerc *widgets.Aerc, args []string) error {
 				})
 		}
 	}
-	acct.Messages().Scroll()
+	acct.Messages().Invalidate()
 	return nil
 }