diff --git a/editors/nvi2/Makefile b/editors/nvi2/Makefile index dfa27945a477..9240ea4f4994 100644 --- a/editors/nvi2/Makefile +++ b/editors/nvi2/Makefile @@ -1,47 +1,47 @@ PORTNAME= nvi2 PORTVERSION= 2.2.0 DISTVERSIONPREFIX= v -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= editors MAINTAINER= leres@FreeBSD.org COMMENT= Updated implementation of the ex/vi text editor WWW= https://github.com/lichray/nvi2/ LICENSE= BSD3CLAUSE USES= bdb cmake compiler:c11 ncurses USE_GITHUB= yes GH_ACCOUNT= lichray CONFLICTS_INSTALL= nvi-m17n nvi OPTIONS_DEFINE= DEBUG WIDECHAR ICONV OPTIONS_DEFAULT= WIDECHAR ICONV WIDECHAR_DESC= Enable wide-character support (UTF-8) ICONV_DESC= Enable iconv support DEBUG_CMAKE_BOOL= ENABLE_DEBUG ICONV_CMAKE_BOOL= ENABLE_ICONV ICONV_USES= iconv WIDECHAR_CMAKE_BOOL= ENABLE_WIDECHAR PLIST_FILES= bin/nex \ bin/nvi \ bin/nview \ man/man1/nex.1.gz \ man/man1/nvi.1.gz \ man/man1/nview.1.gz do-install: ${INSTALL_PROGRAM} ${BUILD_WRKSRC}/nvi ${STAGEDIR}${PREFIX}/bin ${LN} ${STAGEDIR}${PREFIX}/bin/nvi ${STAGEDIR}${PREFIX}/bin/nex ${LN} ${STAGEDIR}${PREFIX}/bin/nvi ${STAGEDIR}${PREFIX}/bin/nview ${INSTALL_MAN} ${WRKSRC}/man/vi.1 \ ${STAGEDIR}${MAN1PREFIX}/man/man1/nvi.1 ${LN} -sf nvi.1 ${STAGEDIR}${MAN1PREFIX}/man/man1/nex.1 ${LN} -sf nvi.1 ${STAGEDIR}${MAN1PREFIX}/man/man1/nview.1 .include 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; \ ++ } \ + } + + /*