MingaEditor.Mouse.HitTest (Minga v0.1.0)

Copy Markdown View Source

Resolves mouse screen coordinates to editor targets.

Summary

Types

position_result()

@type position_result() ::
  {:position, MingaEditor.Mouse.Target.Buffer.position()}
  | {:command, term()}
  | :block_noop
  | :miss

state()

@type state() :: MingaEditor.State.t()

target()

@type target() ::
  {:buffer, MingaEditor.Mouse.Target.Buffer.t()}
  | {:command, term()}
  | :block_noop
  | :miss

Functions

buffer_gutter_width(buffer, total_lines)

@spec buffer_gutter_width(pid() | nil, non_neg_integer()) :: non_neg_integer()

clamp_col_to_line(buffer, line, col)

@spec clamp_col_to_line(pid(), non_neg_integer(), non_neg_integer()) ::
  non_neg_integer()

content_text_width(buffer, total_lines, content_width)

@spec content_text_width(pid(), non_neg_integer(), pos_integer()) :: pos_integer()

position(state, buf, window, local_row, visible_col, scroll_top, arg)

resolve_buffer(state, row, col)

@spec resolve_buffer(state(), integer(), integer()) :: target()

scroll_top(arg1, content_height, content_width, cursor_line, buffer)

@spec scroll_top(
  MingaEditor.Window.t() | nil,
  pos_integer(),
  pos_integer(),
  non_neg_integer(),
  pid()
) ::
  non_neg_integer()