Commit 9078b22c08

9078b22c085573fab0ccdf0492b2034d0c73ed24

parent: 34c85ad93d

Unsigned

Damir Jelić <poljar@termina.org.uk> · 2021-01-01 14:12 UTC

room: Correctly sort the buffer lines

Layout: unified · split

src/room/mod.rs +1 −2
@@ -34,7 +34,6 @@ pub const BUFFER_CLOSED_ERROR: &str =
34use std::{ 34use std::{
35 borrow::Cow, 35 borrow::Cow,
36 cell::RefCell, 36 cell::RefCell,
37 cmp::Reverse,
38 collections::HashMap, 37 collections::HashMap,
39 ops::Deref, 38 ops::Deref,
40 rc::Rc, 39 rc::Rc,
@@ -781,7 +780,7 @@ impl MatrixRoom {
781 if let Ok(buffer) = self.buffer_handle().upgrade() { 780 if let Ok(buffer) = self.buffer_handle().upgrade() {
782 let mut lines: Vec<LineCopy> = 781 let mut lines: Vec<LineCopy> =
783 buffer.lines().map(|l| l.into()).collect(); 782 buffer.lines().map(|l| l.into()).collect();
784 lines.sort_by_key(|l| Reverse(l.date)); 783 lines.sort_by_key(|l| l.date);
785 784
786 for (line, new) in buffer.lines().zip(lines.drain(..)) { 785 for (line, new) in buffer.lines().zip(lines.drain(..)) {
787 let tags = 786 let tags =