From df1e5769e966809951f957e3009b35649cb91678 Mon Sep 17 00:00:00 2001 From: cy384 Date: Sat, 23 Jan 2021 12:33:40 -0500 Subject: [PATCH] don't clear the scrap on copy if there's nothing selected --- ssheven.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ssheven.c b/ssheven.c index 9ae58ee..9884b00 100644 --- a/ssheven.c +++ b/ssheven.c @@ -287,13 +287,13 @@ void ssh_paste(void) void ssh_copy(void) { - OSErr e = ZeroScrap(); - if (e != noErr) printf_i("Failed to ZeroScrap!"); - char* selection = NULL; size_t len = get_selection(&selection); if (selection == NULL || len == 0) return; + OSErr e = ZeroScrap(); + if (e != noErr) printf_i("Failed to ZeroScrap!"); + e = PutScrap(len, 'TEXT', selection); if (e != noErr) printf_i("Failed to PutScrap!"); }