use owo_colors::Style;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum DiffTag {
Equal,
Delete,
Replace,
Insert,
}
impl DiffTag {
pub(crate) fn style(&self) -> Style {
match self {
DiffTag::Equal => Style::new(),
DiffTag::Delete => Style::new().red(),
DiffTag::Replace => Style::new().yellow(),
DiffTag::Insert => Style::new().green(),
}
}
pub(crate) fn marker(&self) -> char {
match self {
DiffTag::Equal => ' ',
DiffTag::Delete => '-',
DiffTag::Replace => '~',
DiffTag::Insert => '+',
}
}
}