aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authora3v <a3v-srht@mit.edu>2019-09-01 19:44:27 -0400
committerDrew DeVault <sir@cmpwn.com>2019-09-02 10:27:54 +0900
commit2257b29a821908b421f08767af52bbe50869fef6 (patch)
tree94acfea3beb1553e1996fcb976c21cb60d95c33e
parente4104a867401e383ef2b45f4c449b8b3fa25e69b (diff)
Use sort.Stable for sorting displayed messages
With sort.Sort, sometimes two messages with the same timestamp will switch places every time the message list is redrawn
-rw-r--r--widgets/msglist.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/widgets/msglist.go b/widgets/msglist.go
index a316cf5..39d57e0 100644
--- a/widgets/msglist.go
+++ b/widgets/msglist.go
@@ -96,7 +96,7 @@ func (ml *MessageList) Draw(ctx *ui.Context) {
)
uids := store.Uids()
sorter := msgSorter{uids: uids, store: store}
- sort.Sort(&sorter)
+ sort.Stable(&sorter)
for i := len(uids) - 1 - ml.scroll; i >= 0; i-- {
uid := uids[i]