fix: check clipboard is not empty before pasting in helix mode

This commit is contained in:
CJ van den Berg 2025-11-04 14:09:20 +01:00
parent 03f2821e5f
commit 76952a7d1b
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -897,6 +897,11 @@ fn paste_helix(ctx: command.Context, do_paste: pasting_function) command.Result
else else
tui.clipboard_get_group(0); tui.clipboard_get_group(0);
if (clipboard.len == 0) {
ed.logger.print("paste: nothing to paste", .{});
return;
}
const b = try ed.buf_for_update(); const b = try ed.buf_for_update();
var root = b.root; var root = b.root;