Module colorizer.buffer_utils
Helper functions to highlight buffer smartly
-
highlight_buffer (buf, ns, lines, line_start, options)
-
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
-
rehighlight_buffer (buf, options)
-
Rehighlight the buffer if colorizer is active
Parameters:
- buf
number: Buffer number
- options
table: Buffer options
-
HIGHLIGHT_MODE_NAMES
-
Highlight mode which will be use to render the colour
Fields:
- background
- foreground
- virtualtext
-
DEFAULT_NAMESPACE
-
Default namespace used in highlight_buffer and colorizer.attach_to_buffer.
See also: