summaryrefslogtreecommitdiffstats
path: root/src/style.rs
diff options
context:
space:
mode:
authorDan Davison <dandavison7@gmail.com>2020-07-17 18:49:55 -0400
committerDan Davison <dandavison7@gmail.com>2020-08-01 11:35:50 -0400
commitcd7953c176c2bc71b34cc2aaa1618f6ab208538f (patch)
tree9571d07e3a9f5015b58afd4abb884f59e6157067 /src/style.rs
parent27dec271018c589ba1119a180158903b9dba8c64 (diff)
Initial implementation of color-moved support
- Inspect the raw hunk line - If it does not appear to be a standard minus/plus line, treat it as moved - Apply special delta color-moved-* styles
Diffstat (limited to 'src/style.rs')
-rw-r--r--src/style.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/style.rs b/src/style.rs
index bfdbbeae..51403130 100644
--- a/src/style.rs
+++ b/src/style.rs
@@ -85,6 +85,10 @@ impl Style {
}
}
+ pub fn is_applied_to(&self, s: &str) -> bool {
+ s.starts_with(&self.ansi_term_style.prefix().to_string())
+ }
+
pub fn to_painted_string(&self) -> ansi_term::ANSIGenericString<str> {
self.paint(self.to_string())
}