MingaEditor.KeystrokeHistory (Minga v0.1.0)

Copy Markdown View Source

Bounded list of the most recent keystrokes for the lossage display (SPC h l).

A pure functional module, no GenServer. The struct lives on MingaEditor.State (global, not per-tab) and is updated once per key event, after dispatch but before post-key housekeeping.

Entries are stored newest-first internally and returned in chronological order by entries/1.

Summary

Types

entry()

@type entry() :: MingaEditor.KeystrokeHistory.Entry.t()

t()

@type t() :: %MingaEditor.KeystrokeHistory{
  entries: [entry()],
  max_size: pos_integer()
}

Functions

entries(keystroke_history)

@spec entries(t()) :: [entry()]

new()

@spec new() :: t()

new(max_size)

@spec new(pos_integer()) :: t()

record(history, entry)

@spec record(t(), entry()) :: t()

size(keystroke_history)

@spec size(t()) :: non_neg_integer()