Module Ansi_text.Style_ranges

include module type of Style_ranges
type range = {
  1. start : int;
  2. end_ : int;
  3. style : Style.t;
}
val compare_range : range -> range -> int
val compare_range__local : range @ local -> (range @ local -> int) @ local
val equal_range : range -> range -> bool
val equal_range__local : range @ local -> (range @ local -> bool) @ local
val sexp_of_range : range -> Sexplib0.Sexp.t
val range_of_sexp : Sexplib0.Sexp.t -> range
type t = range list
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 identify : [ Ansi_text__.Ansi.t | `Text of Text.t ] list -> t * [ `Control of Control.t | `Style of Style.t | `Hyperlink of Ansi_text__.Hyperlink.t | `Unknown of Unknown_esc.t ] list

Identifies ranges for as many styles as possible. Also returns a list of the remaining styles and control-codes that couldn't be accounted for.

val apply : text:Text.t -> t -> [ Ansi_text__.Ansi.t | `Text of Text.t ] list

Makes an Ansi_text.t with the given style-ranges

val adjust_by : ?start:int -> ?end_:int -> t -> t

Updates all ranges, moving their start and end by the given amounts (default = 0).

val exclude : start:int -> end_:int -> t -> t

Adjusts style-ranges to remove all styling between start and end_.

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

Splits the ranges appropriately for splitting the text at a given position, producing two lists of ranges: those that end before and those that start after pos, with starts/ends in the after-list adjusted accordingly. Ranges straddling pos are included in both lists, modified to start/end at the split.