Source-Changes-HG archive

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

[src/trunk]: src/lib/libedit PR/53682: Jordan Lewis: use newlines instead of ...



details:   https://anonhg.NetBSD.org/src/rev/6721505ebd7d
branches:  trunk
changeset: 994834:6721505ebd7d
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Nov 24 12:17:35 2018 +0000

description:
PR/53682: Jordan Lewis: use newlines instead of padded spaces when restoring
multi-line histories.

diffstat:

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

diffs (63 lines):

diff -r ef4dfd61adbb -r 6721505ebd7d lib/libedit/terminal.c
--- a/lib/libedit/terminal.c    Sat Nov 24 11:27:37 2018 +0000
+++ b/lib/libedit/terminal.c    Sat Nov 24 12:17:35 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: terminal.c,v 1.33 2017/06/27 23:23:09 christos Exp $   */
+/*     $NetBSD: terminal.c,v 1.34 2018/11/24 12:17:35 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.33 2017/06/27 23:23:09 christos Exp $");
+__RCSID("$NetBSD: terminal.c,v 1.34 2018/11/24 12:17:35 christos Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -509,36 +509,14 @@
                return;
        }
        if ((del = where - el->el_cursor.v) > 0) {
-               while (del > 0) {
-                       if (EL_HAS_AUTO_MARGINS &&
-                           el->el_display[el->el_cursor.v][0] != '\0') {
-                                size_t h = (size_t)
-                                   (el->el_terminal.t_size.h - 1);
-                                for (; h > 0 &&
-                                         el->el_display[el->el_cursor.v][h] ==
-                                                 MB_FILL_CHAR;
-                                         h--)
-                                                continue;
-                               /* move without newline */
-                               terminal_move_to_char(el, (int)h);
-                               terminal_overwrite(el, &el->el_display
-                                   [el->el_cursor.v][el->el_cursor.h],
-                                   (size_t)(el->el_terminal.t_size.h -
-                                   el->el_cursor.h));
-                               /* updates Cursor */
-                               del--;
-                       } else {
-                               if ((del > 1) && GoodStr(T_DO)) {
-                                       terminal_tputs(el, tgoto(Str(T_DO), del,
-                                           del), del);
-                                       del = 0;
-                               } else {
-                                       for (; del > 0; del--)
-                                               terminal__putc(el, '\n');
-                                       /* because the \n will become \r\n */
-                                       el->el_cursor.h = 0;
-                               }
-                       }
+               if ((del > 1) && GoodStr(T_DO)) {
+                       terminal_tputs(el, tgoto(Str(T_DO), del, del), del);
+                       del = 0;
+               } else {
+                       for (; del > 0; del--)
+                               terminal__putc(el, '\n');
+                       /* because the \n will become \r\n */
+                       el->el_cursor.h = 0;
                }
        } else {                /* del < 0 */
                if (GoodStr(T_UP) && (-del > 1 || !GoodStr(T_up)))



Home | Main Index | Thread Index | Old Index