From 339531252ea000db61b51e6c86197d51be6da94e Mon Sep 17 00:00:00 2001 From: AhoyISki Date: Fri, 20 Jan 2023 13:10:11 -0300 Subject: [PATCH 1/2] Derived copy and clone for SetCursorStyle. --- src/cursor.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cursor.rs b/src/cursor.rs index 277e013ce..663df4435 100644 --- a/src/cursor.rs +++ b/src/cursor.rs @@ -371,6 +371,7 @@ impl Command for DisableBlinking { /// # Note /// /// - Commands must be executed/queued for execution otherwise they do nothing. +#[derive(Clone, Copy)] pub enum SetCursorStyle { /// Default cursor shape configured by the user. DefaultUserShape, From 4f8ac707e4c18a658a104a4b2dc6ea63d3baf8bd Mon Sep 17 00:00:00 2001 From: AhoyISki Date: Wed, 31 Jul 2024 20:40:30 -0300 Subject: [PATCH 2/2] Minor fixes to missing things from other underlines. --- src/style/stylize.rs | 4 ++++ src/style/types/attribute.rs | 22 +++++++++++----------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/style/stylize.rs b/src/style/stylize.rs index fcb12da5c..87bf14700 100644 --- a/src/style/stylize.rs +++ b/src/style/stylize.rs @@ -105,6 +105,10 @@ pub trait Stylize: Sized { stylize_method!(reset Attribute::Reset); stylize_method!(bold Attribute::Bold); stylize_method!(underlined Attribute::Underlined); + stylize_method!(double_underlined Attribute::DoubleUnderlined); + stylize_method!(undercurled Attribute::Undercurled); + stylize_method!(underdotted Attribute::Underdotted); + stylize_method!(underdashed Attribute::Underdashed); stylize_method!(reverse Attribute::Reverse); stylize_method!(dim Attribute::Dim); stylize_method!(italic Attribute::Italic); diff --git a/src/style/types/attribute.rs b/src/style/types/attribute.rs index 8b7d52ca4..0b17b865c 100644 --- a/src/style/types/attribute.rs +++ b/src/style/types/attribute.rs @@ -101,16 +101,6 @@ Attribute! { /// Underlines the text. Underlined = 4, - // Other types of underlining - /// Double underlines the text. - DoubleUnderlined = 2, - /// Undercurls the text. - Undercurled = 3, - /// Underdots the text. - Underdotted = 4, - /// Underdashes the text. - Underdashed = 5, - /// Makes the text blinking (< 150 per minute). SlowBlink = 5, /// Makes the text blinking (>= 150 per minute). @@ -151,6 +141,16 @@ Attribute! { NotFramedOrEncircled = 54, /// Turns off the `OverLined` attribute. NotOverLined = 55, + // Other types of underlining + + /// Double underlines the text. + DoubleUnderlined = 2, + /// Undercurls the text. + Undercurled = 3, + /// Underdots the text. + Underdotted = 4, + /// Underdashes the text. + Underdashed = 5, } impl Display for Attribute { @@ -175,7 +175,7 @@ impl Attribute { /// /// See pub fn sgr(self) -> String { - if (self as usize) > 4 && (self as usize) < 9 { + if (self as usize) > 23 { return "4:".to_string() + SGR[self as usize].to_string().as_str(); } SGR[self as usize].to_string()