diff options
author | Jesse Luehrs <doy@tozt.net> | 2019-12-06 22:15:49 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2019-12-06 23:28:04 -0500 |
commit | e13049c91c036354b311bc529b0b258aa4b61952 (patch) | |
tree | bf8b21cbffe4545c0e58ba1827d249c662675ee8 /src/grid.rs | |
parent | e156958580d91b3244e4806ef1a6aa18e900a823 (diff) | |
download | vt100-rust-e13049c91c036354b311bc529b0b258aa4b61952.tar.gz vt100-rust-e13049c91c036354b311bc529b0b258aa4b61952.zip |
fix contents when a wrapped row is followed by an empty row
Diffstat (limited to 'src/grid.rs')
-rw-r--r-- | src/grid.rs | 4 |
1 files changed, 3 insertions, 1 deletions
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') { |