summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/msgstore.go2
-rw-r--r--widgets/msglist.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/msgstore.go b/lib/msgstore.go
index a54b20b..4aaad82 100644
--- a/lib/msgstore.go
+++ b/lib/msgstore.go
@@ -491,7 +491,7 @@ func (store *MessageStore) Uids() []uint32 {
func (store *MessageStore) Selected() *models.MessageInfo {
uids := store.Uids()
- idx := len(uids) - store.selected - 1
+ idx := store.selected
if len(uids) == 0 || idx < 0 || idx >= len(uids) {
return nil
}
diff --git a/widgets/msglist.go b/widgets/msglist.go
index e9603ca..395fb54 100644
--- a/widgets/msglist.go
+++ b/widgets/msglist.go
@@ -92,7 +92,7 @@ func (ml *MessageList) Draw(ctx *ui.Context) {
threads := store.Threads
counter := len(store.Uids())
- for i := len(threads) - 1; i >= 0; i-- {
+ for i := 0; i < len(threads); i++ {
var lastSubject string
threads[i].Walk(func(t *types.Thread, _ int, currentErr error) error {
if currentErr != nil {