diff --git a/sys/dev/vt/vt_buf.c b/sys/dev/vt/vt_buf.c index 9c9417d6eca..f525e73c8bb 100644 --- a/sys/dev/vt/vt_buf.c +++ b/sys/dev/vt/vt_buf.c @@ -816,6 +816,9 @@ vtbuf_set_mark(struct vt_buf *vb, int type, int col, int row) break; } } + /* No space - word extends to beginning of line. */ + if (i == -1) + vb->vb_mark_start.tp_col = 0; for (i = col; i < vb->vb_scr_size.tp_col; i ++) { if (TCHAR_CHARACTER(r[i]) == ' ') { vb->vb_mark_end.tp_col = i;