[Bug 261553] vt newcons: double click does not mark whole word if word starts at beginning of line

From: <bugzilla-noreply_at_freebsd.org>
Date: Mon, 21 Feb 2022 03:21:12 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=261553

--- Comment #1 from Ed Maste <emaste@freebsd.org> ---
See VTB_MARK_WORD in sys/dev/vt/vt_buf.c

This (untested) patch may fix it:

diff --git a/sys/dev/vt/vt_buf.c b/sys/dev/vt/vt_buf.c
index 9c9417d6eca4..6aae6054d6c5 100644
--- a/sys/dev/vt/vt_buf.c
+++ b/sys/dev/vt/vt_buf.c
@@ -814,6 +814,8 @@ vtbuf_set_mark(struct vt_buf *vb, int type, int col, int
row)
                        if (TCHAR_CHARACTER(r[i]) == ' ') {
                                vb->vb_mark_start.tp_col = i + 1;
                                break;
+                       } else if (i == 0) {
+                               vb->vb_mark_start.tp_col = i;
                        }
                }
                for (i = col; i < vb->vb_scr_size.tp_col; i ++) {

(Note that if the word continued from the previous line we would only highlight
from the beginning of the line. This would presumably be addressed with more
extensive work for PR260963.)

-- 
You are receiving this mail because:
You are the assignee for the bug.