Skip to content

feat(core): split Extend into CoverLanding vs Span#1113

Open
kronberger-droid wants to merge 2 commits into
nushell:mainfrom
kronberger-droid:selection-extent
Open

feat(core): split Extend into CoverLanding vs Span#1113
kronberger-droid wants to merge 2 commits into
nushell:mainfrom
kronberger-droid:selection-extent

Conversation

@kronberger-droid

Copy link
Copy Markdown
Collaborator
  • New SelectionExtent (CoverLanding | Span): per-mode selection-model axis, orthogonal to CaretGeometry.
  • EditCommand::Extend branches on it:
    • vi → CoverLanding (put_cursor)
    • bar modes → Span (extend_span).
  • Cursor::extend_span: grows a Span to gap-indexed op_end, no vi-visual widening
  • Both placement strategies funnel through Editor::place (set_cursor + commit_cursor).

Why

  • Splits where the caret rests (geometry) from how far a motion drags the head (extent).
  • Span is Helix groundwork, since no current mode pairs Block + Span, so that reversal path is exercised by unit tests only.

Tests

  • extend_span units incl. the Helix-bound block-reversal flip.
  • Successive emacs Extend(w) grows the Span.

Notes

  • No public API change (all pub(crate)).
  • Fully behavior preserving.
  • fmt + clippy --all-targets clean; full suite green.

kronberger-droid and others added 2 commits June 29, 2026 14:43
- SelectionExtent axis chosen per edit mode (vi -> CoverLanding,
  bar modes -> Span); orthogonal to CaretGeometry
- Cursor::extend_span grows a Span without vi-visual widening,
  sharing flip_anchor (extracted from put_cursor) on reversal
- funnel both placement strategies through Editor::place
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant