don't clear the scrap on copy if there's nothing selected

This commit is contained in:
cy384 2021-01-23 12:33:40 -05:00
parent 51c41578e7
commit df1e5769e9
1 changed files with 3 additions and 3 deletions

View File

@ -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!");
}