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. Segment selection comes from Minga.Config.Options, and custom segments come from Minga.Config.ModelineSegments.
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 built-in modeline segment names.
Returns the cursor shape for the given mode.
Returns configured modeline segments for native GUI status bars.
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 context() :: %{ data: modeline_data(), theme: MingaEditor.UI.Theme.t(), bar_bg: non_neg_integer(), bar_fg: non_neg_integer(), info_bg: non_neg_integer(), info_fg: non_neg_integer(), mode_bg: non_neg_integer(), mode_fg: non_neg_integer() }
@type git_diff_summary() :: {non_neg_integer(), non_neg_integer(), non_neg_integer()} | nil
Git diff summary: {added, modified, deleted} line counts.
@type gui_segment() :: {atom(), String.t(), non_neg_integer(), non_neg_integer(), keyword(), atom() | nil}
@type gui_segments() :: %{left: [gui_segment()], right: [gui_segment()]}
@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, optional(:safe_mode) => boolean(), :file_name => String.t(), :workspace_label => String.t(), :workspace_draft_count => non_neg_integer(), :workspace_conflict_count => non_neg_integer(), :merge_conflict_count => non_neg_integer(), :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(:active_tool_name) => String.t() | nil, 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, optional(:indent_type) => :spaces | :tabs, optional(:indent_size) => pos_integer(), optional(:selection_info) => {:chars, non_neg_integer()} | {:lines, pos_integer()} | nil, optional(:background_subagent_count) => non_neg_integer(), optional(:active_background_subagent_label) => String.t() | nil }
Data for rendering the modeline.
@type parser_status() :: :available | :unavailable | :restarting
Parser availability status for the modeline indicator.
@type render_segment() :: Minga.Config.ModelineSegment.render_segment()
@type segment_group() :: %{ name: atom(), priority: integer(), segments: [render_segment()] }
Functions
@spec built_in_segments() :: [atom()]
Returns the built-in modeline segment names.
@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 gui_segments( modeline_data(), MingaEditor.UI.Theme.t(), Minga.Config.ModelineSegments.table() ) :: gui_segments()
Returns configured modeline segments for native GUI status bars.