···1111let max (a : int) b = if a > b then a else b
1212let min (a : int) b = if a < b then a else b
13131414-let is_C0 x = (x < 0x20 || x = 0x7f) && x!= 0x09
1414+(**
1515+checks to see if x is any of the early control codes, excluding some whitespace like
1616+0x09 = lf
1717+*)
1818+let is_C0 x = (x < 0x20 || x = 0x7f) && x!= 0x09
1519and is_C1 x = 0x80 <= x && x < 0xa0
1620let is_ctrl x = is_C0 x || is_C1 x
1721and is_ascii x = x < 0x80
+6
jj_tui/lib/ansiReverse.ml
···140140;;
141141142142let string_to_image ?(extra_attr = A.empty) str =
143143+ let str=
144144+ (* replace any carrriage returns becasue notty doesn't know what to do with them*)
145145+ Base.String.Search_pattern.replace_all (Base.String.Search_pattern.create "\r\n") ~in_:str ~with_:"\n"
146146+ |>
147147+ Base.String.Search_pattern.replace_all (Base.String.Search_pattern.create "\r") ~with_:"\n"
148148+ in
143149 match parse_ansi_escape_codes str with
144150 | Error a ->
145151 Printf.printf "restut: %s" a;