mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
selection: selection_to_clipboard: exit early on no-selection
When there's no selection, exit early to avoid trying to get grid data from row -1.
This commit is contained in:
parent
da92abef31
commit
f9e7ae8a89
1 changed files with 3 additions and 0 deletions
|
|
@ -564,6 +564,9 @@ text_to_clipboard(struct terminal *term, char *text, uint32_t serial)
|
|||
void
|
||||
selection_to_clipboard(struct terminal *term, uint32_t serial)
|
||||
{
|
||||
if (term->selection.start.row == -1 || term->selection.end.row == -1)
|
||||
return;
|
||||
|
||||
/* Get selection as a string */
|
||||
char *text = extract_selection(term);
|
||||
if (!text_to_clipboard(term, text, serial))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue