diff options
author | Dan Davison <dandavison7@gmail.com> | 2020-06-16 21:15:56 -0400 |
---|---|---|
committer | Dan Davison <dandavison7@gmail.com> | 2020-06-17 15:07:56 -0400 |
commit | c2c279b5fb8b79d5ce2991682ca6a0c5958f87c3 (patch) | |
tree | ec08c517dcade0dda6e8f9d46c14d28aea5949b2 /src/style.rs | |
parent | 5d5b4a3995e109b24b420daa094773ac4e6dc5bf (diff) |
Highlight added/removed empty lines if they would be invisible
Thanks @phillipwood
Diffstat (limited to 'src/style.rs')
-rw-r--r-- | src/style.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/style.rs b/src/style.rs index 6b11725f..7e7bea35 100644 --- a/src/style.rs +++ b/src/style.rs @@ -49,6 +49,14 @@ impl Style { } } + pub fn has_background_color(&self) -> bool { + if self.ansi_term_style.is_reverse { + self.ansi_term_style.foreground.is_some() + } else { + self.ansi_term_style.background.is_some() + } + } + /// Construct Style from style and decoration-style strings supplied on command line, together /// with defaults. A style string is a space-separated string containing 0, 1, or 2 colors /// (foreground and then background) and an arbitrary number of style attributes. See `delta |