mirror of
https://github.com/sharkdp/bat.git
synced 2025-10-03 18:42:28 +01:00
add line highlight
This commit is contained in:
@@ -18,8 +18,9 @@ pub fn as_terminal_escaped(
|
||||
text: &str,
|
||||
true_color: bool,
|
||||
colored: bool,
|
||||
background_color: Option<highlighting::Color>,
|
||||
) -> String {
|
||||
let style = if !colored {
|
||||
let mut style = if !colored {
|
||||
Style::default()
|
||||
} else {
|
||||
let color = to_ansi_color(style.foreground, true_color);
|
||||
@@ -35,5 +36,6 @@ pub fn as_terminal_escaped(
|
||||
}
|
||||
};
|
||||
|
||||
style.background = background_color.map(|c| to_ansi_color(c, true_color));
|
||||
style.paint(text).to_string()
|
||||
}
|
||||
|
Reference in New Issue
Block a user