Module colorizer.buffer_utils

Helper functions to highlight buffer smartly

Functions

highlight_buffer (buf, ns, lines, line_start, options, options_local) Highlight the buffer region.
rehighlight_buffer (buf, options, options_local) Rehighlight the buffer if colorizer is active

Tables

HIGHLIGHT_MODE_NAMES Highlight mode which will be use to render the colour

Fields

DEFAULT_NAMESPACE Default namespace used in highlight_buffer and colorizer.attach_to_buffer.


Functions

highlight_buffer (buf, ns, lines, line_start, options, options_local)
Highlight the buffer region. Highlight starting from line_start (0-indexed) for each line described by lines in the buffer buf and attach it to the namespace ns.

Parameters:

  • buf number: buffer id
  • ns number: The namespace id. Default is DEFAULT_NAMESPACE. Create it with vim.api.create_namespace
  • lines table: the lines to highlight from the buffer.
  • line_start number: line_start should be 0-indexed
  • options table: Configuration options as described in setup
  • options_local table: Buffer local variables

Returns:

    nil|boolean|number,function|nil
rehighlight_buffer (buf, options, options_local)
Rehighlight the buffer if colorizer is active

Parameters:

  • buf number: Buffer number
  • options table: Buffer options
  • options_local table|nil: Buffer local variables

Returns:

    nil|boolean|number,function|nil

Tables

HIGHLIGHT_MODE_NAMES
Highlight mode which will be use to render the colour

Fields:

  • background
  • foreground
  • virtualtext

Fields

DEFAULT_NAMESPACE
Default namespace used in highlight_buffer and colorizer.attach_to_buffer.

See also:

generated by LDoc 1.4.6 Last updated 2022-09-06 15:06:04