1
0
mirror of https://github.com/sharkdp/bat.git synced 2025-10-03 18:42:28 +01:00

Merge branch 'master' of https://github.com/tskinn/bat into tskinn-master

This commit is contained in:
sharkdp
2018-12-16 20:43:36 +01:00
4 changed files with 38 additions and 4 deletions

View File

@@ -19,8 +19,9 @@ pub fn as_terminal_escaped(
true_color: bool,
colored: bool,
italics: 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);
@@ -36,5 +37,6 @@ pub fn as_terminal_escaped(
}
};
style.background = background_color.map(|c| to_ansi_color(c, true_color));
style.paint(text).to_string()
}