Function termdiff::signs_color_theme [−][src]
pub fn signs_color_theme() -> ThemeExpand description
A simple colorful theme using signs
use termdiff::{diff, signs_color_theme};
let old = "a\nb\nc";
let new = "a\nc\n";
let mut buffer: Vec<u8> = Vec::new();
diff(&mut buffer, old, new, signs_color_theme()).unwrap();
let actual: String = String::from_utf8(buffer).expect("Not valid UTF-8");
assert_eq!(
actual,
"\u{1b}[38;5;9m--- remove\u{1b}[39m | \u{1b}[38;5;10minsert +++\u{1b}[39m
a
\u{1b}[38;5;9m-\u{1b}[39m\u{1b}[38;5;9mb
\u{1b}[39m\u{1b}[38;5;9m-\u{1b}[39m\u{1b}[38;5;9mc\u{1b}[39m
\u{1b}[38;5;10m+\u{1b}[39m\u{1b}[38;5;10mc
\u{1b}[39m"
);