aboutsummaryrefslogtreecommitdiffstats
path: root/app/msglist.go
diff options
context:
space:
mode:
Diffstat (limited to 'app/msglist.go')
-rw-r--r--app/msglist.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/app/msglist.go b/app/msglist.go
index a5e5fbb6..38970123 100644
--- a/app/msglist.go
+++ b/app/msglist.go
@@ -51,6 +51,23 @@ type messageRowParams struct {
headers *mail.Header
}
+// AlignMessage aligns the selected message to position pos.
+func (ml *MessageList) AlignMessage(pos AlignPosition) {
+ store := ml.Store()
+ if store == nil {
+ return
+ }
+ idx := 0
+ iter := store.UidsIterator()
+ for i := 0; iter.Next(); i++ {
+ if store.SelectedUid() == iter.Value().(uint32) {
+ idx = i
+ break
+ }
+ }
+ ml.Align(idx, pos)
+}
+
func (ml *MessageList) Draw(ctx *ui.Context) {
ml.height = ctx.Height()
ml.width = ctx.Width()