pub enum Target {
Motion(MotionId, Args),
TextObject(TextObjectId, Args),
Range(Range),
}Expand description
What an operator acts on: the w in dw, the iw in diw, the % in
:%d. The dispatcher resolves it against the document and cursor to a
concrete span before calling the operator.
An invocation’s explicit range wins over its target when both are
set; an operator with neither fails with
crate::CommandError::MissingTarget.
Variants§
Motion(MotionId, Args)
Run the motion from the cursor; the span is cursor..landing point,
with the motion’s own inclusive / linewise flags deciding the ends.
The Args are the motion’s own (e.g. the char for f<c>). If the
motion cannot move, the operator is cancelled
(crate::CommandError::MotionFailed).
TextObject(TextObjectId, Args)
Evaluate the text object at the cursor (iw, a(, tree-sitter
af); the span is whatever it selects. Args as for Motion.
Range(Range)
An explicit grammar Range – line range, marks, %, or the
current Visual selection.