Skip to content

feat: dG and cG with single-step undo#13

Merged
oribarilan merged 1 commit into
mainfrom
feat/dG-cG
May 31, 2026
Merged

feat: dG and cG with single-step undo#13
oribarilan merged 1 commit into
mainfrom
feat/dG-cG

Conversation

@oribarilan

Copy link
Copy Markdown
Owner

Adds dG and cG (delete/change from cursor to buffer end). Uses editBuffer.deleteRange() instead of the higher-level selection + backspace approach, which lets the host editor treat it as one operation.

The host's undo system splits multi-line deletions into per-line entries, so u after dG would only restore one line at a time. Fixed by saving a pre-operation snapshot and restoring from it on undo. The snapshot is invalidated when any other buffer-modifying action runs. This also fixes undo for de and ce which had the same pattern.

@oribarilan oribarilan merged commit aa6a5d8 into main May 31, 2026
1 check passed
@oribarilan oribarilan deleted the feat/dG-cG branch May 31, 2026 18:48
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