feat: add new reversed modifier

This commit is contained in:
sxyazi 2023-10-15 09:11:55 +08:00
parent e12ebd38e0
commit 85b4892d40
No known key found for this signature in database
3 changed files with 9 additions and 0 deletions

View File

@ -134,6 +134,7 @@ rules = [
{ mime = "application/x-rar", fg = "magenta" },
# Fallback
{ name = "*", blink = true },
{ name = "*/", fg = "blue" }
]

View File

@ -52,6 +52,8 @@ impl Filetype {
#[serde(default)]
blink_rapid: bool,
#[serde(default)]
reversed: bool,
#[serde(default)]
hidden: bool,
#[serde(default)]
crossed: bool,
@ -73,6 +75,7 @@ impl Filetype {
underline: r.underline,
blink: r.blink,
blink_rapid: r.blink_rapid,
reversed: r.reversed,
hidden: r.hidden,
crossed: r.crossed,
}

View File

@ -55,6 +55,8 @@ pub(super) struct StyleShadow {
#[serde(default)]
pub(super) blink_rapid: bool,
#[serde(default)]
pub(super) reversed: bool,
#[serde(default)]
pub(super) hidden: bool,
#[serde(default)]
pub(super) crossed: bool,
@ -81,6 +83,9 @@ impl From<StyleShadow> for Style {
if value.blink_rapid {
modifier |= Modifier::RAPID_BLINK;
}
if value.reversed {
modifier |= Modifier::REVERSED;
}
if value.hidden {
modifier |= Modifier::HIDDEN;
}