summaryrefslogtreecommitdiff
path: root/src/mouse.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/mouse.zig')
-rw-r--r--src/mouse.zig6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mouse.zig b/src/mouse.zig
index 7d2df7e8..c3cf64af 100644
--- a/src/mouse.zig
+++ b/src/mouse.zig
@@ -479,7 +479,7 @@ fn chordCutPaste(p: *Pardes, cut: bool) edit.Error!void {
// 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);
+ try edit.pushUndo(p, &pane.body);
p.view().chord_hold = true;
const sl = pane.sel[sel_slot];
pane.sel[sel_slot].state = .none;
@@ -510,7 +510,7 @@ fn chordCutPaste(p: *Pardes, cut: bool) edit.Error!void {
const y = p.registers.text(p.gpa, pardes.Registers.default) orelse return;
if (y.len == 0) return;
const at = modal.Cursor{ .row = @intCast(@max(0, pane.body.cur_row)), .col = @intCast(@max(0, pane.body.cur_col)) };
- edit.pushUndo(p, &pane.body);
+ try edit.pushUndo(p, &pane.body);
const new = try modal.insertAt(p.gpa, f.content, at, y);
panes.File.setContent(p, f, new);
pane.body.vsel = .{ .active = modal.nextGrapheme(y, 0) < y.len, .row = @intCast(at.row), .col = @intCast(at.col), .explicit = false };
@@ -1174,7 +1174,7 @@ fn mirrorTtySelection(p: *Pardes, pane: *Pane) void {
pane.body.restore_cursor = false;
pane.body.sticky_col = -1;
pane.body.normal.clear();
- edit.setYank(p, text);
+ edit.setYank(p, text) catch |err| p.reportError(p.view().active, "yank", err);
}
/// acme's double-click (text.c:881 textselect, plan9port text.c:1407