Skip to content

Commit

Permalink
Fix colorization in paginated output
Browse files Browse the repository at this point in the history
  • Loading branch information
slarse committed Nov 6, 2023
1 parent 71d634a commit 92648be
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down

0 comments on commit 92648be

Please sign in to comment.