From nobody Tue Aug 29 22:45:39 2023 X-Original-To: dev-commits-ports-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 4Rb2ZX2gyMz4rJxT; Tue, 29 Aug 2023 22:45:40 +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 4Rb2ZX1ncMz3Qn3; Tue, 29 Aug 2023 22:45:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693349140; 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=NQT/TtIEoOeIOl5AI9z4nRc/GDtxKXEqPFG3fa5hkW8=; b=bO9YH5V99DgHHBgVmpqfiXGveDjnxu5HQEKHDN9U1QoI3YKvpJiGEqxpfs4q1U+ZAamK9q 9G3auA1C9J9Mh8qP8s2KtggL8OwIqVtQ7zq8CT3e/9K5pA607vTyrW4o8NXGqthfBB1yBl wjQeh3PnTagxU+lvgCjBx5qtrr87XoXCeLOG5Hc2jiZ3UwQFgfnpVrTqxZzJoacH4go7XL 2PEZIT7fOfAO7VV/kkpqltTlf+dzwnx0nm3Nit4yz+pIi+Hdm6Ll39Y9d7nVRWjudrbAEj xFK/VEi+4q3veK+grsniFI6QoHXcKKSvbZpKKMA9wPTi5Ad08LAbhIC6eWFeEw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693349140; a=rsa-sha256; cv=none; b=jBmxsVVbqhZ4K060mGC24wLmIlTOV4LvcwG1WrBglA8LZmKIc3AmEUK/s1/u2Qyi8Jy16p VJPQTXvweuJ/DVUyxdXFVG+qcefOKXbDi0amCU2UxHbiHX9hDSVZhoybR5t2ec/r9+rXrY 3P38tQQU70lOD1Bbs1sm3eY1T2HtocUc4H9RZJe6qFo+mhkpi6ashSZudlWzRZ+y1MN5h9 t0+L4nhCTRcaum09V0SB3KBBJWeGs7ebIcug23JZsSvYQfBKhX0V8Sy4zacVDlMWQygpjN 1tj1XKIVm7dC1i+SIxZNlcso3zpsK1Odu7a7GRQXtoNkjbcd0AlMV+aT24pe5A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693349140; 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=NQT/TtIEoOeIOl5AI9z4nRc/GDtxKXEqPFG3fa5hkW8=; b=cQLJmwRnbgOZaW1yeKE1169xCBao6DhBKPjhaL/F0WOeX/uB26wjE7tClh2i70KHJM0ENq XpDlsM0vm/LCLUsjvXGIfHwG1NNC0NTVaPI6HobmH2Gma1FNSPVjrGpcu5zaZDZjpy4PnT sc3w2ydQ7WlzGQ4mK1Da+Rjw4hoRWKh5gEQ/v6QrjiD7sfEgLX2uYbOs8Qra4Su0DLPCsw X/rIBCYEwKoGWkB2DNqP7jsaQikHEJkgUMrQuzEcyb8eyjYML6khlIdsFVsMLmps+SlOwi cD4TQM6P0wQ2FCdO25uG0v4pUxXiVTFJxQSQw59vcrVqUymSZfZ2N2a7pq5CXQ== 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 4Rb2ZX0P0Hz1979; Tue, 29 Aug 2023 22:45:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37TMjd4V086612; Tue, 29 Aug 2023 22:45:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37TMjdUd086609; Tue, 29 Aug 2023 22:45:39 GMT (envelope-from git) Date: Tue, 29 Aug 2023 22:45:39 GMT Message-Id: <202308292245.37TMjdUd086609@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Craig Leres Subject: git: 8f10d31b4cfa - main - editors/nvi2: Fix "move forward paragraphs" (}) with numeric prefix List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: leres X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8f10d31b4cfaf46496a805b0b13d8b2ea209289b Auto-Submitted: auto-generated The branch main has been updated by leres: URL: https://cgit.FreeBSD.org/ports/commit/?id=8f10d31b4cfaf46496a805b0b13d8b2ea209289b commit 8f10d31b4cfaf46496a805b0b13d8b2ea209289b Author: Craig Leres AuthorDate: 2023-08-29 22:45:01 +0000 Commit: Craig Leres CommitDate: 2023-08-29 22:45:01 +0000 editors/nvi2: Fix "move forward paragraphs" (}) with numeric prefix Two github issues identified the same problem: https://github.com/lichray/nvi2/issues/118 https://github.com/lichray/nvi2/pull/119 For example typing "}" three times on this sample text: .PP 1 .PP 2 .PP 3 .PP 4 .PP 5 .PP 6 moves the cursor 3 paragraphs but typing "3}" (correct) moves the cursor 5 paragraphs ((2 * N) - 1, incorrect). Reported by: Walter Alejandro Iglesias, Zhihao Yuan --- editors/nvi2/Makefile | 2 +- editors/nvi2/files/patch-vi_v__paragraph.c | 45 ++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/editors/nvi2/Makefile b/editors/nvi2/Makefile index dfa27945a477..9240ea4f4994 100644 --- a/editors/nvi2/Makefile +++ b/editors/nvi2/Makefile @@ -1,7 +1,7 @@ PORTNAME= nvi2 PORTVERSION= 2.2.0 DISTVERSIONPREFIX= v -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= editors MAINTAINER= leres@FreeBSD.org diff --git a/editors/nvi2/files/patch-vi_v__paragraph.c b/editors/nvi2/files/patch-vi_v__paragraph.c new file mode 100644 index 000000000000..caa061cb8dfb --- /dev/null +++ b/editors/nvi2/files/patch-vi_v__paragraph.c @@ -0,0 +1,45 @@ +From 517d821de7939f74a74bb6a553df0fff425fdead Mon Sep 17 00:00:00 2001 +From: Zhihao Yuan +Date: Tue, 29 Aug 2023 03:50:08 -0500 +Subject: [PATCH] Treat consecutive paragraph indicators as different + paragraphs (#119) + +Consecutive empty lines count toward the same state, so there're +2x states (to get in and out). ^L and .PP are counted as text, +hitting those in the text should be treated as getting out of a +paragraph and then getting in. + +Closes: #118 +See also: https://marc.info/?l=openbsd-bugs&m=169100763926909&w=2 +--- + vi/v_paragraph.c | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +diff --git a/vi/v_paragraph.c b/vi/v_paragraph.c +index abe8d9cf..2d7f0756 100644 +--- vi/v_paragraph.c.orig 2020-08-01 22:27:51 UTC ++++ vi/v_paragraph.c +@@ -39,15 +39,20 @@ + if (p[0] == '\014') { \ + if (!--cnt) \ + goto found; \ ++ if (pstate == P_INTEXT && !--cnt) \ ++ goto found; \ + continue; \ + } \ + if (p[0] != '.' || len < 2) \ + continue; \ + for (lp = VIP(sp)->ps; *lp != '\0'; lp += 2) \ + if (lp[0] == p[1] && \ +- (lp[1] == ' ' && len == 2 || lp[1] == p[2]) && \ +- !--cnt) \ +- goto found; \ ++ (lp[1] == ' ' && len == 2 || lp[1] == p[2])) { \ ++ if (!--cnt) \ ++ goto found; \ ++ if (pstate == P_INTEXT && !--cnt) \ ++ goto found; \ ++ } \ + } + + /*