Groups syntax-highlighting fields from EditorState.
Tracks per-buffer highlight data, a monotonic version counter for invalidation, the mapping from buffer PIDs to parser buffer IDs (monotonically incrementing u32s), and LRU timestamps for inactive tree eviction.
Highlight spans are stored per-buffer in highlights. There is no
separate "current" field; the active buffer's highlight is just
Map.get(highlights, active_pid).
Summary
Functions
Stores highlight data for a buffer.
Removes all highlight-related state for a buffer.
Rebuilds every buffer's highlight face registry from a new theme.
Replaces the highlight map.
Replaces syntax overrides.
Sets the highlight state version.
Types
@type t() :: %MingaEditor.State.Highlighting{ buffer_ids: %{required(pid()) => non_neg_integer()}, highlights: %{required(pid()) => MingaEditor.UI.Highlight.t()}, last_active_at: %{required(pid()) => integer()}, next_buffer_id: non_neg_integer(), reverse_buffer_ids: %{required(non_neg_integer()) => pid()}, syntax_overrides: %{required(pid()) => MingaEditor.UI.Theme.syntax()}, version: non_neg_integer() }
Functions
@spec put_highlight(t(), pid(), MingaEditor.UI.Highlight.t()) :: t()
Stores highlight data for a buffer.
@spec remove_buffer(t(), pid(), non_neg_integer(), %{ required(pid()) => non_neg_integer() }) :: t()
Removes all highlight-related state for a buffer.
@spec retheme_all(t(), MingaEditor.UI.Theme.t()) :: t()
Rebuilds every buffer's highlight face registry from a new theme.
Buffers with a stored syntax_overrides entry (e.g. the agent buffer's
dimmed delimiters) keep their custom, theme-independent palette and are
left untouched.
@spec set_highlights(t(), %{required(pid()) => MingaEditor.UI.Highlight.t()}) :: t()
Replaces the highlight map.
@spec set_syntax_overrides(t(), %{required(pid()) => MingaEditor.UI.Theme.syntax()}) :: t()
Replaces syntax overrides.
@spec set_version(t(), non_neg_integer()) :: t()
Sets the highlight state version.