chiark / gitweb /
Forgot to wrap overlong lines.
authorSimon Tatham <anakin@pobox.com>
Wed, 27 Dec 2023 14:32:41 +0000 (14:32 +0000)
committerSimon Tatham <anakin@pobox.com>
Wed, 27 Dec 2023 14:32:41 +0000 (14:32 +0000)
src/main.rs

index 538f1b8247d0090b482e6d4951a8cc815327f75d..4bc57be866d554309d61790fed7d95e538b2de3a 100644 (file)
@@ -186,8 +186,10 @@ fn tui(paras: Vec<Paragraph>) -> std::io::Result<()> {
                 let mut y = 0;
                 for para in &paras {
                     for line in para.render(area.width as usize) {
-                        ratatui_set_string(buf, y, 0, &line.slice());
-                        y += 1;
+                        for line in line.split(area.width as usize) {
+                            ratatui_set_string(buf, y, 0, &line);
+                            y += 1;
+                        }
                     }
                 }
             })?;