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
This commit is contained in:
parent
e4104a8674
commit
2257b29a82
|
@ -96,7 +96,7 @@ func (ml *MessageList) Draw(ctx *ui.Context) {
|
||||||
)
|
)
|
||||||
uids := store.Uids()
|
uids := store.Uids()
|
||||||
sorter := msgSorter{uids: uids, store: store}
|
sorter := msgSorter{uids: uids, store: store}
|
||||||
sort.Sort(&sorter)
|
sort.Stable(&sorter)
|
||||||
|
|
||||||
for i := len(uids) - 1 - ml.scroll; i >= 0; i-- {
|
for i := len(uids) - 1 - ml.scroll; i >= 0; i-- {
|
||||||
uid := uids[i]
|
uid := uids[i]
|
||||||
|
|
Loading…
Reference in New Issue