aboutsummaryrefslogtreecommitdiffstats
path: root/src/display.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/display.c')
-rw-r--r--src/display.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/display.c b/src/display.c
index 19df767..28b63e7 100644
--- a/src/display.c
+++ b/src/display.c
@@ -169,6 +169,14 @@ void runes_display_set_selection(
display->has_selection = 1;
+ display->selection_start = *start;
+ display->selection_end = *end;
+
+ if (t->display->selection_contents) {
+ free(t->display->selection_contents);
+ t->display->selection_contents = NULL;
+ }
+
if (end->row < start->row || (end->row == start->row && end->col < start->col)) {
struct vt100_loc *tmp;
@@ -177,13 +185,6 @@ void runes_display_set_selection(
end = tmp;
}
- display->selection_start = *start;
- display->selection_end = *end;
-
- if (t->display->selection_contents) {
- free(t->display->selection_contents);
- t->display->selection_contents = NULL;
- }
vt100_screen_get_string_plaintext(
t->scr, start, end,
&t->display->selection_contents, &t->display->selection_len);