Doom Emacs-style modeline rendering.
Renders the colored status line at row N-2. Takes a data map and viewport
width; returns a list of draw tuples and a list of clickable regions. Has
no dependency on the GenServer or any mutable state, just a pure
data → {draws, click_regions} transformation.
Click regions are {col_start, col_end, command} tuples attached to
segments at render time, matching how Doom Emacs embeds local-map text
properties and Neovim embeds %@ClickHandler@ markers. The mouse handler
looks up the command for a clicked column without reverse-engineering the
layout.
Summary
Types
A clickable region: column range mapping to a command.
Git diff summary: {added, modified, deleted} line counts.
LSP connection status for the modeline indicator.
Data for rendering the modeline.
Parser availability status for the modeline indicator.
Functions
Returns the cursor shape for the given mode.
Renders the modeline at the given row using the provided data.
Types
@type click_region() :: {col_start :: non_neg_integer(), col_end :: non_neg_integer(), command :: atom()}
A clickable region: column range mapping to a command.
@type git_diff_summary() :: {non_neg_integer(), non_neg_integer(), non_neg_integer()} | nil
Git diff summary: {added, modified, deleted} line counts.
@type lsp_status() :: :ready | :initializing | :starting | :error | :none
LSP connection status for the modeline indicator.
@type modeline_data() :: %{ :mode => Minga.Mode.mode(), :mode_state => Minga.Mode.state() | nil, :file_name => String.t(), :filetype => atom(), :dirty_marker => String.t(), :cursor_line => non_neg_integer(), :cursor_col => non_neg_integer(), :line_count => non_neg_integer(), :buf_index => pos_integer(), :buf_count => non_neg_integer(), :macro_recording => {true, String.t()} | false, optional(:agent_status) => MingaEditor.State.Agent.status(), optional(:agent_theme_colors) => MingaEditor.UI.Theme.Agent.t() | nil, optional(:mode_override) => String.t() | nil, optional(:lsp_status) => lsp_status(), optional(:parser_status) => parser_status(), optional(:git_branch) => String.t() | nil, optional(:git_diff_summary) => git_diff_summary(), optional(:diagnostic_counts) => {non_neg_integer(), non_neg_integer(), non_neg_integer(), non_neg_integer()} | nil }
Data for rendering the modeline.
@type parser_status() :: :available | :unavailable | :restarting
Parser availability status for the modeline indicator.
Functions
@spec cursor_shape(Minga.Mode.mode() | MingaEditor.VimState.t()) :: MingaEditor.Frontend.Protocol.cursor_shape()
Returns the cursor shape for the given mode.
Accepts either a bare mode atom or the full vim state map. When the
vim state is passed, pending: :replace in normal mode produces
an underline cursor (matching Vim's r feedback).
@spec render( non_neg_integer(), pos_integer(), modeline_data(), MingaEditor.UI.Theme.t(), non_neg_integer() ) :: {[MingaEditor.DisplayList.draw()], [click_region()]}
Renders the modeline at the given row using the provided data.
Returns {draw_commands, click_regions} where click_regions is a list of
{col_start, col_end, command_atom} tuples for mouse hit-testing.