From nobody Tue Feb 22 14:12:21 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 6542A19E6BE6; Tue, 22 Feb 2022 14:12:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4K31MT2P4rz4yvX; Tue, 22 Feb 2022 14:12:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645539141; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+YHt4rCj+axR3JJFLQWdkvgHuDAX1SifTtfxG7wJ7V4=; b=d1kJE1kyMwxXw7IeMtauF0uA+h+/17Y4xuU1oW/Byupnvj6BSL3lY8Ylhrlqg3+iCrmDdh kGIVh561YpEfXRj+GdUfDQKCTyx+QuCoaWexMW9ZfpwziQAg4SzHqLIQ4+MQRQ/y3rAJSK goLZg6w2HbTVSlUsNgCuvYHD8ajZHklXs32t7V/TRGAbo5L6QESbOgDP9vLq+JnAYqSA8x bWuqpNQSH+qhPmV5SuNrDJPl1zZBs5zR2Solcy70NMfLoOu1hYDMfFnYg+rn5dmwLNvpa5 FF5XIlhSNk6EVZXTfdNr5xJ2CPiBgBRSkOlRCkjjcs1fvi/TTTvzRgO8HQgeew== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3221A25440; Tue, 22 Feb 2022 14:12:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 21MECLCK064066; Tue, 22 Feb 2022 14:12:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21MECLVZ064065; Tue, 22 Feb 2022 14:12:21 GMT (envelope-from git) Date: Tue, 22 Feb 2022 14:12:21 GMT Message-Id: <202202221412.21MECLVZ064065@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 692bb3f0291b - main - vt: fix double-click word selection for first word on line List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 692bb3f0291b21337eb9a778f71a5b97a47e4c11 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645539141; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+YHt4rCj+axR3JJFLQWdkvgHuDAX1SifTtfxG7wJ7V4=; b=TcHfL64n1aO20PS96b5z2dLroqMKvmZc5OmDuNgStFK3ZOvXJ66C476nfWezPV16DuYv+m 5Ne1bmseYove3nz639SkcIF5NSQ6OuMl12CbR+G+MxBYYGsWae3bKP1mazZjzVwHGrCxCO elsjguz2CSJ8n5Zaw5rtmj2ukAFBkDQ0PO8w9hXNh2elo5qjWBdWjij+HGjmeDbLwE6Yx5 3EyWQDaMvoL42CvVPohTr6vwYKohxYt+H/YR/QayzC8jfZRSWfxk7YZ2E4XM70bHwKOVIu UmpzPM9ExvNgubdenrdq2cf4yKNYzPdmKdAp93NaxjEHOxcpbSh3bUQHKfGVKQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1645539141; a=rsa-sha256; cv=none; b=Pbym7+HDwzNYbnDH27bh/VcRSpWs5e7cYr6F4/x2Uc2K6zX1zzI4QZA/zNXLGAibOYVP7e xfBzfTAMNrhJHrR+c1I6nSp7Zt/CX+kzjaLujYWPvxfYJeywF64L8/KG9VXwp0nfwXZiKq ZnJeiVbAoAiS3RcQ56hYi4/aZTKKi8Scghs9XainP3oc3lvj8HeAbMMrAlmvo/yXrpuIkV /D28r7CU7YblhY5X33fVV0NWZ76YT8YfgK28tiCt5wKRNeCJx0g+8OENrGv8spx9OiKPKa AKkzPByYNo5OKumOocgyeQOCR8Z0AO7i0jAp4mdUTXAHlYMKH/S2bvklISaWYw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=692bb3f0291b21337eb9a778f71a5b97a47e4c11 commit 692bb3f0291b21337eb9a778f71a5b97a47e4c11 Author: Ed Maste AuthorDate: 2022-02-21 04:09:36 +0000 Commit: Ed Maste CommitDate: 2022-02-22 14:08:50 +0000 vt: fix double-click word selection for first word on line Previously when double-clicking on the first word on a line we would select from the cursor position to the end of the word, not from the beginning of the line. This is because we searched backward for a space to mark the beginning of a word. Now, use the beginning of the line if we do not find a space. PR: 261553 Reported by: Stefan B. MFC after: 1 week Sponsored by: The FreeBSD Foundation --- sys/dev/vt/vt_buf.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/dev/vt/vt_buf.c b/sys/dev/vt/vt_buf.c index 9c9417d6eca4..f525e73c8bbe 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;