summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDan Davison <dandavison7@gmail.com>2020-05-31 17:15:55 -0400
committerDan Davison <dandavison7@gmail.com>2020-05-31 17:15:55 -0400
commitbce5ccf6b40eaa3f6dff766f47984813e3b41ee4 (patch)
tree8e93238c0058f1502feaa4e82428ab6bd72e8a81 /src
parentc293800e88289437225ac8e8da733e29898733ee (diff)
Allow --ELEMENT-decoration-style=none
Diffstat (limited to 'src')
-rw-r--r--src/style.rs2
-rw-r--r--src/tests/test_example_diffs.rs7
2 files changed, 9 insertions, 0 deletions
diff --git a/src/style.rs b/src/style.rs
index 22529bc5..a5981743 100644
--- a/src/style.rs
+++ b/src/style.rs
@@ -176,6 +176,7 @@ impl DecorationStyle {
Some("ul") => DecorationStyle::Underline(style),
Some("overline") => DecorationStyle::Overline(style),
Some("underoverline") => DecorationStyle::Underoverline(style),
+ Some("none") => DecorationStyle::NoDecoration,
Some("omit") => DecorationStyle::NoDecoration,
Some("plain") => DecorationStyle::NoDecoration,
// TODO: Exit with error if --thing-decoration-style supplied without a decoration type
@@ -296,6 +297,7 @@ fn extract_special_decoration_attribute(style_string: &str) -> (String, Option<S
|| token == "underline"
|| token == "overline"
|| token == "underoverline"
+ || token == "none"
|| token == "plain"
});
match special_attributes {
diff --git a/src/tests/test_example_diffs.rs b/src/tests/test_example_diffs.rs
index 43b94680..5ee26956 100644
--- a/src/tests/test_example_diffs.rs
+++ b/src/tests/test_example_diffs.rs
@@ -591,6 +591,13 @@ src/align.rs
}
#[test]
+ fn test_hunk_header_decoration_style_none() {
+ let mut options = integration_test_utils::get_command_line_options();
+ options.hunk_header_decoration_style = "none".to_string();
+ _do_test_hunk_header_style_no_decoration(options);
+ }
+
+ #[test]
fn test_hunk_header_decoration_style_empty_string() {
let mut options = integration_test_utils::get_command_line_options();
options.hunk_header_decoration_style = "".to_string();