Make modified text blue instead of green (#269)

This commit is contained in:
CosmicHorror 2023-11-02 19:31:21 -06:00 committed by GitHub
parent 4f77cfe1b8
commit 345497a64a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View file

@ -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();

View file

@ -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");
@ -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(())