summaryrefslogtreecommitdiff
path: root/src/edit.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-28 19:21:22 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:15 -0300
commit2580dd5ea85d86262c94363dfea9f990eaf56196 (patch)
treef6ef730304b57653c1ecfe31fac99b7ac0b00cc7 /src/edit.zig
parentb08322345b33abcee114c05c85fa4c46c10f4701 (diff)
downloadpardes-2580dd5ea85d86262c94363dfea9f990eaf56196.tar.gz
pardes-2580dd5ea85d86262c94363dfea9f990eaf56196.zip
Everything a B1 chord does while B1 is down is one undo step
B1-B2 then B1-B3 cut and pasted as two undo steps. acme marks the file once per B1 hold (text.c:881, textselect), so the pair is a copy. The chord now takes one undo point when it begins and its edits share it until B1 comes up. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/edit.zig')
-rw-r--r--src/edit.zig3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/edit.zig b/src/edit.zig
index 8d3a746e..1e480785 100644
--- a/src/edit.zig
+++ b/src/edit.zig
@@ -2012,7 +2012,8 @@ pub fn pushUndo(p: *Pardes, t: *Text) void {
// one keystroke, one undo step — even when it edited at ten cursors.
if (p.multi_on and !p.multi_first) return;
switch (t.what) {
- .body => {},
+ // A B1 chord took its one undo point when it began (mouse.zig).
+ .body => if (p.chord_hold) return,
.tag, .column, .workspace => return t.remember(p.gpa, if (t.own) |own| .{ .text = own } else null),
// a prompt's answer is typed once and gone; it keeps no history
.input => return,