diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-03-21 20:04:39 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-03-21 20:04:39 -0400 |
| commit | c951ee59157ca351f3539a62c377890346e7194d (patch) | |
| tree | 5cdf589b1f6977557bcb57d059cb094875b007ce /examples | |
| parent | c153e052583fecc39f2cac9c40f99218e2e70c41 (diff) | |
Fix colorful
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/colorful/colorful.tm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/colorful/colorful.tm b/examples/colorful/colorful.tm index a9162237..929c2409 100644 --- a/examples/colorful/colorful.tm +++ b/examples/colorful/colorful.tm @@ -42,7 +42,7 @@ func main(texts:[Text], files=[:Path], by_line=no): func _for_terminal(c:Colorful, state:_TermState -> Text): - return c.text:map($/@(?)/, func(m:Match): _add_ansi_sequences(m.captures[1], state)) + return c.text:map(recursive=no, $/@(?)/, func(m:Match): _add_ansi_sequences(m.captures[1], state)) enum _Color(Default, Bright(color:Int16), Color8Bit(color:Int16), Color24Bit(color:Int32)): func from_text(text:Text -> _Color?): @@ -210,6 +210,6 @@ func _add_ansi_sequences(text:Text, prev_state:_TermState -> Text): fail("Invalid attribute: '$attr'") result := prev_state:apply(new_state) - result ++= parts[2]:map($/@(?)/, func(m:Match): _add_ansi_sequences(m.captures[1], new_state)) + result ++= parts[2]:map(recursive=no, $/@(?)/, func(m:Match): _add_ansi_sequences(m.captures[1], new_state)) result ++= new_state:apply(prev_state) return result |
