Module syntect::util

source ·
Expand description

Convenient helper functions for common use cases: printing to terminal, iterating lines with \ns, modifying ranges of highlighted output

Structs§

  • An iterator over the lines of a string, including the line endings.

Functions§

  • Formats the styled fragments using 24-bit color terminal escape codes. Meant for debugging and testing. It’s currently fairly inefficient in its use of escape codes.
  • Formats the styled fragments using LaTeX textcolor directive.
  • Modify part of a highlighted line using a style modifier, useful for highlighting sections of a line.
  • Split a highlighted line at a byte index in the line into a before and after component. It’s just a helper that does the somewhat tricky logic including splitting a span if the index lies on a boundary.