summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--desktop/textarea.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/desktop/textarea.c b/desktop/textarea.c
index 2da2c206b..414408045 100644
--- a/desktop/textarea.c
+++ b/desktop/textarea.c
@@ -183,6 +183,11 @@ static bool textarea_select(struct textarea *ta, int c_start, int c_end,
bool pre_existing_selection = (ta->sel_start != -1);
struct textarea_msg msg;
+ if (c_start == c_end) {
+ textarea_clear_selection(ta);
+ return true;
+ }
+
/* Ensure start is the beginning of the selection */
if (c_start > c_end) {
swap = c_start;