Skip to content

Commit

Permalink
Added deleted line to the clipboard after deletion.
Browse files Browse the repository at this point in the history
  • Loading branch information
sthilaid committed Feb 10, 2023
1 parent 175b97e commit 19672a7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/studio/editors/code.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 19672a7

Please sign in to comment.