]> Sergey Matveev's repositories - nnn.git/commitdiff
Fix #520: minimal erasure
authorArun Prakash Jana <engineerarun@gmail.com>
Sat, 18 Apr 2020 01:48:35 +0000 (07:18 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Sat, 18 Apr 2020 01:48:35 +0000 (07:18 +0530)
src/nnn.c

index b6460f94dd645ec183688136af89d355033bd216..1ecfc38cb886e0077430429d4e70b3edeba44fb3 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -4938,14 +4938,15 @@ static void redraw(char *path)
 
        DPRINTF_S(__FUNCTION__);
 
-       /* Clear screen */
-       erase();
+       /* Go to first line */
+       move(0, 0);
 
        /* Enforce scroll/cursor invariants */
        move_cursor(cur, 1);
 
        /* Fail redraw if < than 10 columns, context info prints 10 chars */
        if (ncols < MIN_DISPLAY_COLS) {
+               clrtobot();
                printmsg(messages[MSG_FEW_COLUMNS]);
                return;
        }
@@ -4997,8 +4998,8 @@ static void redraw(char *path)
 
        attroff(A_UNDERLINE);
 
-       /* Go to first entry */
-       move(2, 0);
+       /* Clear everthing till first entry */
+       addstr("\n\n");
 
        ncols = adjust_cols(ncols);
 
@@ -5015,6 +5016,9 @@ static void redraw(char *path)
                cfg.dircolor = 0;
        }
 
+       /* Clear from last entry to end */
+       clrtobot();
+
        statusbar(path);
 }