Make the example show highlighted areas more explicitly

This commit is contained in:
Clément Renault 2019-11-05 16:40:48 +01:00
parent 85bf5d113c
commit 7541172d12
No known key found for this signature in database
GPG Key ID: 92ADA4E935E71FA4
1 changed files with 5 additions and 1 deletions

View File

@ -217,7 +217,11 @@ fn display_highlights(text: &str, ranges: &[usize]) -> io::Result<()> {
_ => unreachable!(),
};
if highlighted {
stdout.set_color(ColorSpec::new().set_fg(Some(Color::Yellow)))?;
stdout.set_color(
ColorSpec::new()
.set_fg(Some(Color::Yellow))
.set_underline(true),
)?;
}
write!(&mut stdout, "{}", &text[start..end])?;
stdout.reset()?;