From ba204401e86d27102cb130b305f402a7809b523c Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Fri, 8 Nov 2019 10:36:57 -0500 Subject: contents_formatted should also reset attributes for the same reason as contents_diff --- CHANGELOG.md | 2 ++ src/grid.rs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 25f5b56..f958810 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ * Fixed VPA incorrectly being clamped to the scroll region. * Stop treating soft hyphen specially (as far as i can tell, no other terminals do this, and i'm not sure why i thought it was necessary to begin with). +* `contents_formatted` now also resets attributes at the start, like + `contents_diff` does. ## [0.3.1] - 2019-11-06 diff --git a/src/grid.rs b/src/grid.rs index 0d075ea..4951d25 100644 --- a/src/grid.rs +++ b/src/grid.rs @@ -137,7 +137,7 @@ impl Grid { } pub fn contents_formatted(&self) -> Vec { - let mut contents = b"\x1b[H\x1b[J".to_vec(); + let mut contents = b"\x1b[m\x1b[H\x1b[J".to_vec(); let mut prev_attrs = crate::attrs::Attrs::default(); let mut final_col = 0; for row in self.rows() { -- cgit v1.2.3-54-g00ecf