pub struct ListChars {
pub tab_lead: char,
pub tab_fill: Option<char>,
pub space: Option<char>,
pub trail: Option<char>,
pub eol: Option<char>,
pub nbsp: Option<char>,
pub extends: Option<char>,
pub precedes: Option<char>,
}Expand description
Invisibles rendering configuration for :set list / :set listchars.
Re-exported from hjkl_buffer::ListChars so callers programming to
the engine surface don’t need to import hjkl-buffer directly.
Invisibles rendering configuration. Matches vim’s :set listchars.
When :set list is on, the render layer substitutes whitespace characters
with the glyphs configured here. None fields mean “no substitution /
not rendered”.
Default matches vim’s built-in default: tab:^I,eol:$.
Fields§
§tab_lead: charLeading char of a tab expansion (required). E.g. > in tab:>-.
tab_fill: Option<char>Fill char repeated to next tabstop. None = single-glyph tab (no fill).
space: Option<char>Substitution for regular spaces. None = no substitution (vim default).
trail: Option<char>Substitution for trailing whitespace. None = falls back to space or no render.
eol: Option<char>Marker appended after the last char on each line. None = no marker.
nbsp: Option<char>Substitution for non-breaking spaces (\u{00a0}). None = no substitution.
extends: Option<char>Char shown at the right edge when a line extends beyond the viewport
(no-wrap mode). None = no marker.
TODO: deferred — requires viewport edge integration.
precedes: Option<char>Char shown at the left edge when the viewport is scrolled right past
the line start. None = no marker.
TODO: deferred — requires viewport edge integration.
Implementations§
Source§impl ListChars
impl ListChars
Sourcepub fn parse(s: &str) -> Result<ListChars, String>
pub fn parse(s: &str) -> Result<ListChars, String>
Parse a vim-style listchars value string.
Accepts comma-separated key:value pairs where value is one or two
chars (UTF-8). tab is the only key that may have two chars
(tab:lead_fill); all others take exactly one char.
Returns Err(String) with a diagnostic on unknown keys or bad values.
Sourcepub fn to_canonical_string(&self) -> String
pub fn to_canonical_string(&self) -> String
Canonical string form for :set listchars?.
Emits only the fields that are set (non-None), always in the order:
tab, space, trail, eol, nbsp, extends, precedes.