mirror of
https://github.com/chmln/sd
synced 2024-11-22 03:03:03 +00:00
Make modified text blue instead of green (#269)
This commit is contained in:
parent
4f77cfe1b8
commit
345497a64a
2 changed files with 5 additions and 5 deletions
|
@ -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();
|
||||
|
|
|
@ -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(())
|
||||
|
|
Loading…
Reference in a new issue