pmacs/builtin
Levi Neuwirth db073cc668 CUA type-over is a single undo step (Q#U1)
Typing over a selection composed two edits in Lua —
delete_region() + insert_char() — so it recorded two undo steps:
one undo left the half-replaced text, two restored the original.
Undo granularity is per apply_edit in both modes (v0.1 pushes one
UndoEntry per edit; CRDT commits per edit via export and groups by
commit, with record_checkpoint unused), so the fix is to make
type-over one edit.

New core EditorCore::insert_char_over_region emits a single
EditOp::Replace when a region is active (cursor past the inserted
bytes, selection cleared) and delegates to insert_char otherwise.
The three type-over commands (buffer.newline / tab / self-insert)
call it via a new Lua binding instead of the delete+insert pair.
delete_region and insert_char are unchanged for their other
callers; region-aware backspace/delete already emit one op.

Verified one undo unit in BOTH modes (dual_mode
replace_is_a_single_undo_step covers v01 + crdt — a CRDT Replace is
delete-then-insert internally but one commit) plus an end-to-end
acceptance test through the key-dispatch path.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-15 20:00:53 -04:00
..
api Fix CI and Documentation issues 2026-05-04 10:19:19 -04:00
commands CUA type-over is a single undo step (Q#U1) 2026-06-15 20:00:53 -04:00
hooks Initial commit: v0.1.0 2026-05-03 19:51:06 -04:00
keymaps CUA region semantics — shift selection, region-aware delete + type-over 2026-06-10 10:50:11 -04:00
packages/repl M7 tail: package system, audit lint, lockfile, resolver 2026-05-07 16:50:37 -04:00
runtime LSP didChange debounce + queued process stdin writer (typing perf) 2026-06-10 10:49:51 -04:00