From 92648bec1cdda72c2c69e3f21d5911ee062b1569 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Lars=C3=A9n?= Date: Mon, 6 Nov 2023 21:38:33 +0100 Subject: [PATCH] Fix colorization in paginated output --- src/status.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/status.rs b/src/status.rs index 411f81e..29264ec 100644 --- a/src/status.rs +++ b/src/status.rs @@ -161,11 +161,11 @@ fn write_human_readable( if !staged_changes.is_empty() { writer.writeln("Changes to be committed:".to_string())?; - writer.set_color(Color::Green)?; for change in staged_changes { + writer.set_color(Color::Green)?; writer.writeln(format!("\t{}", change.human_readable_format()))?; + writer.reset_formatting()?; } - writer.reset_formatting()?; written = true; } @@ -176,11 +176,11 @@ fn write_human_readable( } writer.writeln("Changes not staged for commit:".to_string())?; - writer.set_color(Color::Red)?; for change in unstaged_changes { + writer.set_color(Color::Red)?; writer.writeln(format!("\t{}", change.human_readable_format()))?; + writer.reset_formatting()?; } - writer.reset_formatting()?; written = true; }