MingaEditor.Session.HoverObservation (Minga v0.1.0)

Copy Markdown View Source

Transient pointer observation used for Cmd/Ctrl-hover navigation.

The link and the cell that produced it change together. Keeping both in one value prevents a stale deduplication cell from outliving its visible link. This value is frame-local and is never included in tab snapshots.

Summary

Types

A buffer position as {line, byte_col}.

t()

Functions

Returns whether this observation was resolved at the given cell.

Clears the complete transient hover observation.

Records the pointer cell that produced the current observation.

Records the currently resolved navigation link.

Types

link()

@type link() :: {position(), position()} | nil

position()

@type position() :: {non_neg_integer(), non_neg_integer()}

A buffer position as {line, byte_col}.

t()

@type t() :: %MingaEditor.Session.HoverObservation{
  cell: position() | nil,
  link: link()
}

Functions

at_cell?(hover_observation, cell)

@spec at_cell?(t(), position()) :: boolean()

Returns whether this observation was resolved at the given cell.

clear(hover_observation)

@spec clear(t()) :: t()

Clears the complete transient hover observation.

observe_cell(observation, cell)

@spec observe_cell(t(), position() | nil) :: t()

Records the pointer cell that produced the current observation.

observe_link(observation, link)

@spec observe_link(t(), link()) :: t()

Records the currently resolved navigation link.