pub struct OperatorSpec {
pub repeatable: bool,
pub apply: Arc<dyn Fn(&mut OperatorContext<'_>) -> GrammarResult<Effect> + Send + Sync>,
pub args_schema: Vec<ArgSpec>,
pub blockwise_per_row: bool,
pub post_motion_char: bool,
}Expand description
A registered operator: its evaluator plus how the dispatcher should feed it spans.
Registered through CommandRegistry::register_operator (or
CommandRegistry::register_plugin_operator). The dispatcher resolves
the invocation’s range or target to a span, builds an
OperatorContext, and returns whatever apply returns unchanged.
Fields§
§repeatable: boolDeclared dot-repeatability. Currently informational: nothing reads it
yet (. repeat is decided host-side).
apply: Arc<dyn Fn(&mut OperatorContext<'_>) -> GrammarResult<Effect> + Send + Sync>The evaluator. Runs once per span (once per row for a blockwise
selection when Self::blockwise_per_row).
args_schema: Vec<ArgSpec>Per-positional-argument metadata (DESIGN.md §B.1). Empty for operators without args (the common case).
blockwise_per_row: boolBlock-visual dispatch hint. true (the default for v1
rectangle ops – d, y, c) means a blockwise visual
selection routes per-row: each row’s column slice gets its
own ProtoRange and apply runs once per row, with results
merged into a single Blockwise yank + concatenated Edits.
false (linewise-style ops – >, <, gU, gu, g~)
means a blockwise visual collapses to a single contiguous
range covering anchor..head; apply runs once. This keeps
the operator a single undo unit instead of N per-row units.
post_motion_char: boolWhen true (e.g. surround’s ys{motion}{char}), the operator’s
keymap bindings append ChordPattern::CharLiteral after every
motion path so a wrapping character is captured as Args::Char
by the wildcard resolution. Default false.
Trait Implementations§
Source§impl Clone for OperatorSpec
impl Clone for OperatorSpec
Source§fn clone(&self) -> OperatorSpec
fn clone(&self) -> OperatorSpec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more