File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change 77 ],
88 "depends" : [
99 " Color::DirColors:auth<zef:japhb>:ver<0.0.3+>" ,
10+ " Terminal::ANSIColor:ver<0.14+>:auth<zef:raku-community-modules>"
1011 " Terminal::Capabilities:auth<zef:japhb>:ver<0.0.14+>" ,
1112 " Terminal::LineEditor:auth<zef:japhb>:ver<0.0.23+>" ,
1213 " Terminal::Print:auth<zef:terminal-printers>:ver<0.977+>" ,
Original file line number Diff line number Diff line change 33unit module Terminal::Widgets::TextContent ;
44
55use Text::MiscUtils::Layout;
6+ use Terminal::ANSIColor;
67
78
89# | An exception preventing stringification for content that requires more processing
@@ -38,6 +39,12 @@ class RenderSpan is export {
3839 method width (--> UInt : D ) {
3940 $ ! width // = duospace-width-core($ ! text )
4041 }
42+
43+ # | Stringify to an SGR-escaped string instead of rendering into a widget's
44+ # | content area (use Widget.draw-line-spans for that)
45+ method Str (--> Str : D ) {
46+ colored($ ! text , $ ! color )
47+ }
4148}
4249
4350
You can’t perform that action at this time.
0 commit comments