Skip to main content

register_narrow_operator

Function register_narrow_operator 

Source
pub fn register_narrow_operator(registry: &mut CommandRegistry) -> OperatorId
Expand description

N.1.3 (2026-06-10): register the zn narrow operator into the grammar’s CommandRegistry and return its OperatorId.

The operator is universal — you narrow from any editable buffer, like d / y / c. Per the mode-ownership split, this crate owns the operator SPEC + apply; the host wires the zn chord to the returned OperatorId at the universal operator-pending layer (operator-pending composition needs the host-resolved Builtins, which this crate can’t reach). The narrow-VIEW surface (:widen / :w / q) stays with NarrowMode.

apply reads the resolved OperatorContext.range (the span the following motion / text object produced), converts it to an inclusive whole-line span, and emits Effect::AppAction(AppEffect::NarrowLines { .. }); the host arm narrows the active buffer to that span via create_narrow_view.