Skip to main content

Crate hjkl_statusline

Crate hjkl_statusline 

Source
Expand description

Renderer-agnostic statusline data model.

Build a Bar from host state, then hand it to a renderer adapter (e.g. hjkl-statusline-tui for ratatui, hjkl-statusline-gui for floem).

Naming follows the vim convention (:help statusline, lualine, vim-airline, lightline).

Structs§

Bar
A fully-laid-out statusline: left segments + spacer + right segments.
Color
Resolved RGBA color (all channels 0–255).
Modifiers
Per-character text modifiers.
StatusTheme
Theme colours the status row needs. Caller populates from its own theme.
Style
Alias for hjkl_theme::StyleSpec: foreground, background, modifiers. Foreground, background, and modifier flags for a syntax or UI element.

Enums§

ModeKind
High-level mode classification for color selection.
Segment
A single horizontal segment in the statusline.

Traits§

StyleExt
Extension methods for building a Style (hjkl_theme::StyleSpec) by chaining.

Functions§

cursor_segment
Build the cursor position segment (row:col).
dirty_segment
Build a dirty-marker segment ( when dirty, empty otherwise).
filename_segment
Build the filename segment including suffix tags (e.g. [RO], [New File]).
loading_segment
Build a loading/spinner segment (⠋ label).
mode_segment
Build the mode badge segment (e.g. NORMAL).
pending_segment
Build a pending-count/operator segment ({count}{op}). Returns None when empty.
percent_segment
Build the percentage segment (N%).
recording_segment
Build a recording-register segment (REC @r).
search_count_segment
Build a search-count segment ([idx/total]).
truncate_filename
Truncate filename so it fits in avail display columns, prepending when truncation occurs. Returns the (possibly truncated) string.