From 4eba98313c6f1ddf1070bea8aaf638e8ea455231 Mon Sep 17 00:00:00 2001 From: nicm Date: Wed, 11 Mar 2020 18:46:42 +0000 Subject: [PATCH] Start a new selection if outside the existing selection after a word has been selected. From Anindya Mukherjee. --- window-copy.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/window-copy.c b/window-copy.c index 8e3f63d1..3e6b3e68 100644 --- a/window-copy.c +++ b/window-copy.c @@ -4122,7 +4122,7 @@ window_copy_start_drag(struct client *c, struct mouse_event *m) struct window_pane *wp; struct window_mode_entry *wme; struct window_copy_mode_data *data; - u_int x, y; + u_int x, y, yg; if (c == NULL) return; @@ -4143,6 +4143,9 @@ window_copy_start_drag(struct client *c, struct mouse_event *m) c->tty.mouse_drag_release = window_copy_drag_release; data = wme->data; + yg = screen_hsize(data->backing) + y - data->oy; + if (x < data->selrx || x > data->endselrx || yg != data->selry) + data->selflag = SEL_CHAR; switch (data->selflag) { case SEL_WORD: if (data->ws) {