From e13049c91c036354b311bc529b0b258aa4b61952 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Fri, 6 Dec 2019 22:15:49 -0500 Subject: fix contents when a wrapped row is followed by an empty row --- src/grid.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/grid.rs') diff --git a/src/grid.rs b/src/grid.rs index b29668f..07bcd6f 100644 --- a/src/grid.rs +++ b/src/grid.rs @@ -183,11 +183,13 @@ impl Grid { } pub fn write_contents(&self, contents: &mut String) { + let mut wrapping = false; for row in self.visible_rows() { - row.write_contents(contents, 0, self.size.cols); + row.write_contents(contents, 0, self.size.cols, wrapping); if !row.wrapped() { contents.push_str("\n"); } + wrapping = row.wrapped(); } while contents.ends_with('\n') { -- cgit v1.2.3-54-g00ecf