Skip to content

change/delete commands never populate registers, so d then p pastes nothing #396

Description

@bug-ops

Description

Across the simulator, change/delete commands (including change_selection, bound to both c and, as of #389, Alt-c) never write to sim.registers. The only writers of sim.registers anywhere in the simulator are yank / yank_to_register (src/helix/simulator/commands/clipboard.rs). In upstream Helix, delete and change operations write the deleted text to the active register (default ") so it can subsequently be pasted with p/P, matching standard vi/Helix semantics.

This is the pre-existing bug that the #389 fix's "yank and noyank change_selection are already behaviorally identical" rationale rests on: since neither writes to a register today, reusing the same handler for both change_selection and change_selection_noyank is currently a no-op distinction. Fixing this issue will require splitting that shared registration into two handlers (see the rationale comment added in src/helix/registry/definitions/editing.rs by #389 / PR #394).

Reproduction Steps

  1. In the trainer, position the cursor on a word or make a selection.
  2. Press d (delete) or c (change) to delete/change the selection.
  3. Move the cursor elsewhere and press p to paste.
  4. Observe: nothing is pasted — the deleted text was never written to a register.

Expected Behavior

Delete and change commands should write the deleted text to the default (unnamed) register, so a subsequent p/P pastes it, matching upstream Helix behavior.

Actual Behavior

Registers are only ever populated by explicit yank/yank_to_register commands; delete/change operations silently discard the deleted text.

Environment

Logs / Evidence

Identified via grep for sim.registers writers during adversarial critique and code review of #389 (PR #394). See .local/handoff/2026-08-10T00-59-47-critic.md and .local/handoff/2026-08-10T01-02-26-review.md in that branch's history for details. Note: fixing this issue will require revisiting the shared change_selection/change_selection_noyank registry entry introduced in #389 to split yank vs. noyank behavior once register writes exist.

Metadata

Metadata

Assignees

Labels

P2Suboptimal UX, minor display issuebugSomething isn't workinghelix-coreHelix core integration

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions