This commit is contained in:
radical_honesty on #flashsupport
2023-01-08 17:10:59 -08:00
committed by dupa dup
parent fdf2dfff87
commit 322c3fc022
3 changed files with 54 additions and 0 deletions

View File

@ -0,0 +1,21 @@
{formatting {state {}}} {
if {$state eq ""} {
array set old [empty_formatting]
} else {
array set old $state
}
array set new $formatting
if $old(o) {
array set old [empty_formatting]
}
if $new(o) {
return \017
}
set ret ""
foreach k {b u r} {
if {$old($k) != $new($k)} {
append ret [string map {b \002 u \037 r \026} $k]
}
}
return $ret[unparse_formatting_color [array get new] [array get old]]
}