Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-7-0]: src/external/bsd/nvi/dist/cl Pull up following revision(s) ...



details:   https://anonhg.NetBSD.org/src/rev/a0f31b525d13
branches:  netbsd-7-0
changeset: 801398:a0f31b525d13
user:      snj <snj%NetBSD.org@localhost>
date:      Mon Oct 23 18:50:37 2017 +0000

description:
Pull up following revision(s) (requested by mlelstv in ticket #1508):
        external/bsd/nvi/dist/cl/cl_main.c: revision 1.6
        external/bsd/nvi/dist/cl/cl_screen.c: revision 1.6
When resizing nvi in xterm, a scroll region is set with the old size
which garbles the display.
The scroll region is set for a terminfo scroll operation and then
reset to the current window size. While xterm lets you clear a
scroll region, there is no way to do this in terminfo except by
resetting the terminal which has a visual side effect.
Xterm actually clears the scroll region as part of the resize but
that happens before a program gets the SIGWINCH signal. When nvi sees
the SIGWINCH signal, it exits the vi mode using a scroll operation to
tidy up the display before it reenters vi mode with the new window size.
This patch does two things:
- make nvi also invoke a previous SIGWINCH handler (not sufficient,
  but that's how curses wants it).
- skip the tidy up in case of a restart (avoids the scroll region)

diffstat:

 external/bsd/nvi/dist/cl/cl_main.c   |  8 ++++++--
 external/bsd/nvi/dist/cl/cl_screen.c |  6 +++---
 2 files changed, 9 insertions(+), 5 deletions(-)

diffs (56 lines):

diff -r 2e3a4bc554ea -r a0f31b525d13 external/bsd/nvi/dist/cl/cl_main.c
--- a/external/bsd/nvi/dist/cl/cl_main.c        Mon Oct 23 18:34:50 2017 +0000
+++ b/external/bsd/nvi/dist/cl/cl_main.c        Mon Oct 23 18:50:37 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cl_main.c,v 1.4 2014/01/26 21:43:45 christos Exp $ */
+/*     $NetBSD: cl_main.c,v 1.4.10.1 2017/10/23 18:50:37 snj Exp $ */
 /*-
  * Copyright (c) 1993, 1994
  *     The Regents of the University of California.  All rights reserved.
@@ -16,7 +16,7 @@
 static const char sccsid[] = "Id: cl_main.c,v 10.54 2001/07/29 19:07:27 skimo Exp  (Berkeley) Date: 2001/07/29 19:07:27 ";
 #endif /* not lint */
 #else
-__RCSID("$NetBSD: cl_main.c,v 1.4 2014/01/26 21:43:45 christos Exp $");
+__RCSID("$NetBSD: cl_main.c,v 1.4.10.1 2017/10/23 18:50:37 snj Exp $");
 #endif
 
 #include <sys/types.h>
@@ -294,6 +294,10 @@
        GLOBAL_CLP;
 
        F_SET(clp, CL_SIGWINCH);
+
+       /* If there was a previous handler, call that. */
+       if (clp->oact[INDX_WINCH].sa_handler)
+               clp->oact[INDX_WINCH].sa_handler(signo);
 }
 #undef GLOBAL_CLP
 
diff -r 2e3a4bc554ea -r a0f31b525d13 external/bsd/nvi/dist/cl/cl_screen.c
--- a/external/bsd/nvi/dist/cl/cl_screen.c      Mon Oct 23 18:34:50 2017 +0000
+++ b/external/bsd/nvi/dist/cl/cl_screen.c      Mon Oct 23 18:50:37 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cl_screen.c,v 1.4 2014/01/26 21:43:45 christos Exp $ */
+/*     $NetBSD: cl_screen.c,v 1.4.10.1 2017/10/23 18:50:37 snj Exp $ */
 /*-
  * Copyright (c) 1993, 1994
  *     The Regents of the University of California.  All rights reserved.
@@ -16,7 +16,7 @@
 static const char sccsid[] = "Id: cl_screen.c,v 10.56 2002/05/03 19:59:44 skimo Exp  (Berkeley) Date: 2002/05/03 19:59:44 ";
 #endif /* not lint */
 #else
-__RCSID("$NetBSD: cl_screen.c,v 1.4 2014/01/26 21:43:45 christos Exp $");
+__RCSID("$NetBSD: cl_screen.c,v 1.4.10.1 2017/10/23 18:50:37 snj Exp $");
 #endif
 
 #include <sys/types.h>
@@ -404,7 +404,7 @@
         * Move to the bottom of the window (some endwin implementations don't
         * do this for you).
         */
-       if (!F_ISSET(clp, CL_IN_EX)) {
+       if (!F_ISSET(clp, CL_IN_EX) && !F_ISSET(gp, G_SRESTART)) {
                (void)move(0, 0);
                (void)deleteln();
                (void)move(LINES - 1, 0);



Home | Main Index | Thread Index | Old Index