Skip to content

Commit

Permalink
Merge pull request #32 from imclerran/list-splitat
Browse files Browse the repository at this point in the history
Replace List.split with List.splitAt
  • Loading branch information
imclerran authored Dec 28, 2024
2 parents 7ef00bc + 1941ceb commit 70abcb0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package/Toolkit/Roc.roc
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,10 @@ stripAnsiControl : List U8 -> List U8
stripAnsiControl = \bytes ->
when List.findFirstIndex bytes (\b -> b == 27) is
Ok escapeIndex ->
{ before: lhs, others: remainder } = List.split bytes escapeIndex
{ before: lhs, others: remainder } = List.splitAt bytes escapeIndex
when List.findFirstIndex remainder (\b -> (b >= 'A' && b <= 'Z') || (b >= 'a' && b <= 'z')) is
Ok controlIndex ->
{ before: _, others: rhs } = List.split remainder (controlIndex + 1)
{ before: _, others: rhs } = List.splitAt remainder (controlIndex + 1)
List.concat lhs (stripAnsiControl rhs)
Err _ -> bytes
Err _ -> bytes

0 comments on commit 70abcb0

Please sign in to comment.