Skip to main content

execute_motion_only

Function execute_motion_only 

Source
pub fn execute_motion_only(
    registry: &CommandRegistry,
    buffer: &Buffer,
    buffer_id: BufferId,
    cursor: Position,
    invocation: CommandInvocation,
    cancel: &CancellationToken,
    env: GrammarEnv<'_>,
) -> GrammarResult<Position>
Expand description

Resolve a motion-only invocation against a bare [Buffer] + cursor, without a [Document] / undo stack / selections.

This is the read-only path used by buffer kinds that aren’t document-shaped (today: help buffers; future: file-tree, outline, diagnostics views per DESIGN.md §5.9). The chord grammar is shared – pressing j in a help buffer dispatches the same line_down motion as in a code buffer – but the motion runs against a different rope.

Returns the resolved target [Position]. Operators / text- objects / ex-commands return CommandError::InvalidArgs – callers route those separately (yank possibly excepted, but yank is an operator not a motion). The motion’s linewise flag is dropped: callers that need it (yank-by-motion, etc.) are not expected on read-only buffers.