From 2580dd5ea85d86262c94363dfea9f990eaf56196 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 28 Sep 2026 19:21:22 -0300 Subject: 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 --- src/mouse.zig | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/mouse.zig') diff --git a/src/mouse.zig b/src/mouse.zig index ac3e206b..61bd30e0 100644 --- a/src/mouse.zig +++ b/src/mouse.zig @@ -790,6 +790,7 @@ fn dragRelease(p: *Pardes, button: Mouse.Button) void { // stream; only the button which began this gesture may end it. if (p.drag.button() != button) return; defer p.drag = .none; + defer p.chord_hold = false; switch (p.drag) { .border_v => |d| { const c = d.left_col; @@ -1027,6 +1028,11 @@ fn chordCutPaste(p: *Pardes, cut: bool) void { } if (!s.chorded) { s.chorded = true; + // Everything done while B1 stays down is one undo step, as acme + // marks the file once per B1 hold (text.c:881 textselect, `state` + // and its one filemark): B1-B2 then B1-B3 is a copy. + edit.pushUndo(p, &pane.body); + p.chord_hold = true; const sl = pane.sel[sel_slot]; pane.sel[sel_slot].state = .none; const pfx: i32 = if (pane.file != null) panes.File.gutterWidth(pane) else 0; -- cgit v1.3