NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: bin/57072: nvi error "Error: move: l(24 + 0) c(80 + 0)"
The following reply was made to PR bin/57072; it has been noted by GNATS.
From: RVP <rvp%SDF.ORG@localhost>
To: Simon Burge <simonb%NetBSD.org@localhost>
Cc: Rin Okuyama <rokuyama.rk%gmail.com@localhost>, Brett Lymn <blymn%internode.on.net@localhost>,
gnats-bugs%netbsd.org@localhost
Subject: Re: bin/57072: nvi error "Error: move: l(24 + 0) c(80 + 0)"
Date: Wed, 26 Oct 2022 09:10:22 +0000 (UTC)
On Wed, 26 Oct 2022, Simon Burge wrote:
> I haven't looked closely at the vi code, but would be easier/simplier
> or just plain more-hacky to just not try to put the cursor in the last
> column of the last row? Already it deals with status messages longer
> than (window-width) chars by doing a multiline status message, so maybe
> just tweak that logic to kick in for (window-width - 1)?
>
Here you go. Cooked this up a couple of days back, but, didn't send
it in 'cuz like rin@ I noticed nvi behaved OK with ncurses, but didn't
characterize the bug any further:
---START---
diff -urN external/bsd/nvi.orig/dist/common/exf.c external/bsd/nvi/dist/common/exf.c
--- external/bsd/nvi.orig/dist/common/exf.c 2014-01-26 21:43:45.000000000 +0000
+++ external/bsd/nvi/dist/common/exf.c 2022-10-24 07:45:04.419673627 +0000
@@ -996,6 +996,7 @@
* a single screen column each, we can trim the filename.
*/
s = buf;
+ len++; /* account for '\n' added by msgq() */
if (len >= sp->cols) {
for (s = buf, t = buf + strlen(p); s < t &&
(*s != '/' || len >= sp->cols - 3); ++s, --len);
---END---
-RVP
Home |
Main Index |
Thread Index |
Old Index