MingaEditor.State.Highlighting (Minga v0.1.0)

Copy Markdown View Source

Owns live syntax-highlight presentation caches.

Parser identity, parse sequencing, registration, activity, and eviction belong to Minga.Parser.Manager. This struct contains only per-buffer presentation data and optional syntax palette overrides.

Summary

Functions

Stores highlight data for a buffer.

Removes all highlight presentation state for a buffer.

Rebuilds every buffer's highlight face registry from a new theme.

Replaces the highlight map.

Replaces syntax overrides.

Types

t()

@type t() :: %MingaEditor.State.Highlighting{
  highlights: %{required(pid()) => MingaEditor.UI.Highlight.t()},
  syntax_overrides: %{required(pid()) => MingaEditor.UI.Theme.syntax()}
}

Functions

put_highlight(state, pid, highlight)

@spec put_highlight(t(), pid(), MingaEditor.UI.Highlight.t()) :: t()

Stores highlight data for a buffer.

remove_buffer(state, buffer_pid)

@spec remove_buffer(t(), pid()) :: t()

Removes all highlight presentation state for a buffer.

retheme_all(state, theme)

@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 override keep their custom, theme-independent palette.

set_highlights(state, highlights)

@spec set_highlights(t(), %{required(pid()) => MingaEditor.UI.Highlight.t()}) :: t()

Replaces the highlight map.

set_syntax_overrides(state, overrides)

@spec set_syntax_overrides(t(), %{required(pid()) => MingaEditor.UI.Theme.syntax()}) ::
  t()

Replaces syntax overrides.