package mosaic

  1. Overview
  2. Docs

Module Text_buffer.HighlightSource

Character-range style overlays.

A highlight applies a style overlay to a range of grapheme offsets in the buffer. Highlights are layered by priority (higher wins) and grouped by ref_id for batch removal via remove_highlights_by_ref.

Sourcetype t

A highlight overlay.

Sourceval make : start_offset:int -> end_offset:int -> style:Ansi.Style.t -> ?priority:int -> ref_id:int -> unit -> t

make ~start_offset ~end_offset ~style ~ref_id () is a highlight covering grapheme offsets from start_offset (inclusive) to end_offset (exclusive).

priority defaults to 0. Higher values render on top. ref_id groups related highlights for batch removal via remove_highlights_by_ref.

Sourceval start_offset : t -> int

start_offset h is the inclusive start grapheme offset.

Sourceval end_offset : t -> int

end_offset h is the exclusive end grapheme offset.

Sourceval style : t -> Ansi.Style.t

style h is the style overlay.

Sourceval priority : t -> int

priority h is the rendering priority.

Sourceval ref_id : t -> int

ref_id h is the batch-removal reference.