A virtual text decoration: display-only text injected at a buffer position.
Virtual text is rendered on screen but does not exist in the buffer content. The cursor skips over it. Yank ignores it. It occupies screen columns (for inline/EOL) or screen rows (for above/below) and the viewport accounts for its dimensions, but buffer operations are unaware of it.
Placement modes
:inline- text appears at the anchor column, pushing subsequent buffer content to the right on the same line:eol- text appears after the last character of the anchor line, separated by at least one space:above- entire styled lines injected above the anchor line:below- entire styled lines injected below the anchor line
Summary
Functions
Returns the total display width of the virtual text segments.
Returns the total display width of a list of styled segments.
Types
@type placement() :: :inline | :eol | :above | :below
Placement mode for virtual text.
:inline- at the anchor column, displacing buffer content rightward:eol- after the last character of the anchor line:above- full lines injected above the anchor line:below- full lines injected below the anchor line
@type segment() :: {text :: String.t(), style :: Minga.Core.Face.t()}
A styled text segment: the text string and its Face style.
Functions
@spec display_width(t()) :: non_neg_integer()
Returns the total display width of the virtual text segments.
@spec segments_display_width([segment()]) :: non_neg_integer()
Returns the total display width of a list of styled segments.