package mosaic

  1. Overview
  2. Docs

Module Code.Props

type t

The type for code display props.

val make : ?content:string -> ?spans:Text_buffer.span list -> ?text_style:Ansi.Style.t -> ?wrap:Text_surface.wrap -> ?tab_width:int -> ?truncate:bool -> ?selectable:bool -> ?selection_bg:Ansi.Color.t -> ?selection_fg:Ansi.Color.t -> unit -> t

make () is a code props value with:

  • content is the plain source code text. Defaults to "".
  • spans are pre-computed styled spans (Text_buffer.span list). When present, these override the plain content display. Typically produced by a syntax highlighter. Defaults to [].
  • text_style is the base text style. Defaults to Ansi.Style.default.
  • wrap is the wrapping mode. Defaults to `None.
  • tab_width is the tab stop width in columns. Defaults to 4.
  • truncate controls whether long lines are truncated with an ellipsis. Defaults to false.
  • selectable controls whether text can be selected. Defaults to true.
  • selection_bg is the selection background color.
  • selection_fg is the selection foreground color.
val default : t

default is the default props value.

val equal : t -> t -> bool

equal a b is true iff a and b have the same prop values.