From 19672a749bffcbc928bcd4d7d83758476abe4f55 Mon Sep 17 00:00:00 2001 From: David St-Hilaire Date: Thu, 9 Feb 2023 21:31:21 -0500 Subject: [PATCH] Added deleted line to the clipboard after deletion. --- src/studio/editors/code.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/studio/editors/code.c b/src/studio/editors/code.c index 6d05810f2..8a3f77af7 100644 --- a/src/studio/editors/code.c +++ b/src/studio/editors/code.c @@ -1185,6 +1185,17 @@ static void deleteLine(Code* code) { lineend = findLineEnd(code, linestart); } + + const size_t linesize = lineend-linestart; + char* clipboard = (char*)malloc(linesize+1); + if(clipboard) + { + memcpy(clipboard, linestart, linesize); + clipboard[linesize] = '\0'; + tic_sys_clipboard_set(clipboard); + free(clipboard); + } + deleteCode(code, linestart, lineend); code->cursor.position = linestart;