Source-Changes-HG archive

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

[src/trunk]: src/lib/libedit PR/52359: Benjamin Lorenz: When resizing because...



details:   https://anonhg.NetBSD.org/src/rev/49bbf81058fe
branches:  trunk
changeset: 455775:49bbf81058fe
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Apr 12 17:30:49 2019 +0000

description:
PR/52359: Benjamin Lorenz: When resizing because of a signal save and restore
the cursor position, since it does not change.

diffstat:

 lib/libedit/terminal.c |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (39 lines):

diff -r 7d8ed77722cf -r 49bbf81058fe lib/libedit/terminal.c
--- a/lib/libedit/terminal.c    Fri Apr 12 15:59:34 2019 +0000
+++ b/lib/libedit/terminal.c    Fri Apr 12 17:30:49 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: terminal.c,v 1.35 2019/02/15 23:20:35 christos Exp $   */
+/*     $NetBSD: terminal.c,v 1.36 2019/04/12 17:30:49 christos Exp $   */
 
 /*-
  * Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)term.c     8.2 (Berkeley) 4/30/95";
 #else
-__RCSID("$NetBSD: terminal.c,v 1.35 2019/02/15 23:20:35 christos Exp $");
+__RCSID("$NetBSD: terminal.c,v 1.36 2019/04/12 17:30:49 christos Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -966,9 +966,10 @@
 libedit_private int
 terminal_change_size(EditLine *el, int lins, int cols)
 {
+       coord_t cur = el->el_cursor;
        /*
-         * Just in case
-         */
+        * Just in case
+        */
        Val(T_co) = (cols < 2) ? 80 : cols;
        Val(T_li) = (lins < 1) ? 24 : lins;
 
@@ -976,6 +977,7 @@
        if (terminal_rebuffer_display(el) == -1)
                return -1;
        re_clear_display(el);
+       el->el_cursor = cur;
        return 0;
 }
 



Home | Main Index | Thread Index | Old Index