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" }, { mime = "application/x-rar", fg = "magenta" },
# Fallback # Fallback
{ name = "*", blink = true },
{ name = "*/", fg = "blue" } { name = "*/", fg = "blue" }
] ]

View File

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

View File

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