Module Ansi_text.Text_with_style_ranges

include module type of Text_with_style_ranges
type t = {
  1. text : Text.t;
  2. ranges : Style_ranges.t;
}

Alternative representation that's only valid if all styles have clear start and end positions. This type is far less general than Text_with_ansi.t, and somewhat less thoroughly tested. Its intended use case is re-rendering patdiff output for the web-ui.

include Ppx_compare_lib.Comparable.S with type t := t
val compare : t -> t -> int
include Ppx_compare_lib.Equal.S with type t := t
val equal : t -> t -> bool
include Ppx_compare_lib.Equal.S__local with type t := t
include Ppx_quickcheck_runtime.Quickcheckable.S with type t := t
val quickcheck_generator : t Base_quickcheck.Generator.t
val quickcheck_observer : t Base_quickcheck.Observer.t
val quickcheck_shrinker : t Base_quickcheck.Shrinker.t
include Sexplib0.Sexpable.S with type t := t
include Sexplib0.Sexpable.Of_sexp with type t := t
val t_of_sexp : Sexplib0.Sexp.t -> t
include Sexplib0.Sexpable.Sexp_of with type t := t
val sexp_of_t : t -> Sexplib0.Sexp.t
val width : t -> int
val is_empty : t -> bool
val to_string : t -> string
val to_string_hum : t -> string
val to_unstyled : t -> string
val to_text_with_ansi : t -> [ Ansi_text__.Ansi.t | `Text of Text.t ] list
val of_text_with_ansi : [ Ansi_text__.Ansi.t | `Text of Text.t ] list -> t option
val unstyle_between : start:int -> end_:int -> t -> t

Removes styles between start and end_, shortening ranges as necessary.

val split : pos:int -> t -> t * t