Skip to content

Commit

Permalink
Make modified text blue instead of green (#269)
Browse files Browse the repository at this point in the history
  • Loading branch information
CosmicHorrorDev authored Nov 3, 2023
1 parent 4f77cfe commit 345497a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/replacer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,13 @@ impl Replacer {
new.extend_from_slice(&haystack[last_match..m.start()]);
if use_color {
new.extend_from_slice(
ansi_term::Color::Green.prefix().to_string().as_bytes(),
ansi_term::Color::Blue.prefix().to_string().as_bytes(),
);
}
rep.replace_append(&cap, &mut new);
if use_color {
new.extend_from_slice(
ansi_term::Color::Green.suffix().to_string().as_bytes(),
ansi_term::Color::Blue.suffix().to_string().as_bytes(),
);
}
last_match = m.end();
Expand Down
6 changes: 3 additions & 3 deletions tests/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ mod cli {
.success()
.stdout(format!(
"{}{}def\n",
ansi_term::Color::Green.prefix(),
ansi_term::Color::Green.suffix()
ansi_term::Color::Blue.prefix(),
ansi_term::Color::Blue.suffix()
));

assert_file(file.path(), "abc123def");
Expand Down Expand Up @@ -227,7 +227,7 @@ mod cli {
.success()
.stdout(format!(
"{}\nfoo\nfoo\n",
ansi_term::Color::Green.paint("bar")
ansi_term::Color::Blue.paint("bar")
));

Ok(())
Expand Down

0 comments on commit 345497a

Please sign in to comment.