From 2257b29a821908b421f08767af52bbe50869fef6 Mon Sep 17 00:00:00 2001 From: a3v Date: Sun, 1 Sep 2019 19:44:27 -0400 Subject: 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 --- widgets/msglist.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/widgets/msglist.go b/widgets/msglist.go index a316cf57..39d57e06 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] -- cgit