Mouse event handling for the editor.
Handles scroll, click, drag, and release events, translating screen
coordinates to buffer positions. All functions are pure state -> state
transformations; the buffer is mutated via Buffer calls, but the
GenServer state struct is returned unchanged or updated.
Multi-click selection
- Double-click: select word under cursor, enter Visual mode
- Triple-click: select entire line, enter Visual Line mode
- Double-click + drag: extend selection word-by-word
- Triple-click + drag: extend selection line-by-line
Modifier clicks
- Shift+click: extend visual selection to click position
- Cmd/Super+click: go-to-definition (when LSP active)
- Middle-click: paste at click position
Horizontal scroll
- Wheel left/right: shift viewport horizontally
Summary
Functions
Dispatches a mouse event, returning updated state.
Dispatches a mouse event routed to a focus-tree node.
Types
@type state() :: MingaEditor.State.t()
Internal editor state.
Functions
@spec handle( state(), integer(), integer(), atom(), non_neg_integer(), atom(), pos_integer() ) :: state()
Dispatches a mouse event, returning updated state.
@spec handle_at_node( state(), MingaEditor.FocusTree.Node.t(), integer(), integer(), atom(), non_neg_integer(), atom(), pos_integer() ) :: state()
Dispatches a mouse event routed to a focus-tree node.