add more defaults and make it more presentable

This commit is contained in:
Jeeves 2024-04-05 18:23:58 -06:00
parent 9f0c0d4afb
commit 1d59e48a4f
2 changed files with 34 additions and 3 deletions

View file

@ -413,13 +413,17 @@ pub const String = enum {
exit_am_mode,
exit_attribute_mode,
exit_ca_mode,
exit_blink_mode,
exit_bold_mode,
exit_dim_mode,
exit_delete_mode,
exit_doublewide_mode,
exit_insert_mode,
exit_italics_mode,
exit_leftward_mode,
exit_micro_mode,
exit_reverse_mode,
exit_secure_mode,
exit_shadow_mode,
exit_standout_mode,
exit_subscript_mode,
@ -607,13 +611,17 @@ pub const String = enum {
.exit_am_mode => "rmam",
.exit_attribute_mode => "sgr0",
.exit_ca_mode => "rmcup",
.exit_blink_mode => null,
.exit_bold_mode => null,
.exit_dim_mode => null,
.exit_delete_mode => "rmdc",
.exit_doublewide_mode => "rwidm",
.exit_insert_mode => "rmir",
.exit_italics_mode => "ritm",
.exit_leftward_mode => "rlm",
.exit_micro_mode => "rmicm",
.exit_reverse_mode => null,
.exit_secure_mode => null,
.exit_shadow_mode => "rshm",
.exit_standout_mode => "rmso",
.exit_subscript_mode => "rsubm",
@ -735,7 +743,20 @@ pub const String = enum {
pub fn default(self: String) ?[]const u8 {
return switch (self) {
.enter_bold_mode => "\x1b[1m",
.enter_dim_mode => "\x1b[2m",
.enter_italics_mode => "\x1b[3m",
.enter_underline_mode => "\x1b[4m",
.enter_blink_mode => "\x1b[5m",
.enter_reverse_mode => "\x1b[7m",
.enter_secure_mode => "\x1b[8m",
.exit_bold_mode => "\x1b[22m",
.exit_dim_mode => "\x1b[22m",
.exit_italics_mode => "\x1b[23m",
.exit_underline_mode => "\x1b[24m",
.exit_blink_mode => "\x1b[25m",
.exit_reverse_mode => "\x1b[27m",
.exit_secure_mode => "\x1b[28m",
else => null,
};
}