Commit fd7996d9df
Unsigned
Layout: unified · split
src/room/mod.rs +5 −6
| @@ -853,20 +853,19 @@ impl MatrixRoom { | ||
| 853 | 853 | let line_contains_uuid = |l: &BufferLine| l.tags().contains(&uuid_tag); |
| 854 | 854 | |
| 855 | 855 | let mut lines = buffer.lines(); |
| 856 | let mut first_line = lines.rfind(line_contains_uuid); | |
| 856 | let mut current_line = lines.rfind(line_contains_uuid); | |
| 857 | 857 | |
| 858 | 858 | // We go in reverse order here since we also use rfind(). We got from |
| 859 | 859 | // the bottom of the buffer to the top since we're expecting these |
| 860 | 860 | // lines to be freshly printed and thus at the bottom. |
| 861 | let mut line_num = rendered.content.lines.len() - 1; | |
| 861 | let mut line_num = rendered.content.lines.len(); | |
| 862 | 862 | |
| 863 | while let Some(line) = &first_line { | |
| 863 | while let Some(line) = ¤t_line { | |
| 864 | line_num -= 1; | |
| 864 | 865 | let rendered_line = &rendered.content.lines[line_num]; |
| 865 | 866 | |
| 866 | 867 | line.set_message(&rendered_line.message); |
| 867 | ||
| 868 | line_num -= 1; | |
| 869 | first_line = lines.next_back().filter(line_contains_uuid); | |
| 868 | current_line = lines.next_back().filter(line_contains_uuid); | |
| 870 | 869 | } |
| 871 | 870 | } |
| 872 | 871 | |