]> Sergey Matveev's repositories - nnn.git/commitdiff
Revert "Skip a complete erase on redraw()"
authorArun Prakash Jana <engineerarun@gmail.com>
Thu, 6 May 2021 17:03:30 +0000 (22:33 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Thu, 6 May 2021 17:03:30 +0000 (22:33 +0530)
This reverts commit 41d414c2fc262be7ccb6572919f0c3fe6ae3338f.

src/nnn.c

index 33dd23550a275bcd5bcf8c13a448380396276761..3da955d51e6e33c386010f59e07f37d22bb98dbb 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -5751,19 +5751,18 @@ static void redraw(char *path)
 
        DPRINTF_S(__func__);
 
+       /* Clear screen */
+       erase();
+
+       /* Enforce scroll/cursor invariants */
+       move_cursor(cur, 1);
+
        /* Fail redraw if < than 10 columns, context info prints 10 chars */
-       /* Note: this should be before the Fast redraw, but we optimize */
-       if (ncols <= MIN_DISPLAY_COLS) {
-               erase();
+       if (ncols < MIN_DISPLAY_COLS) {
                printmsg(messages[MSG_FEW_COLUMNS]);
                return;
        }
 
-       move(0, 0);
-
-       /* Enforce scroll/cursor invariants */
-       //move_cursor(cur, 1);
-
        //DPRINTF_D(cur);
        DPRINTF_S(path);
 
@@ -5824,13 +5823,11 @@ static void redraw(char *path)
 
        ncols = adjust_cols(ncols);
 
-       clrtoeol(); /* Clear to end of first line */
-
-       move(1, 0);
        /* Go to first entry */
-       if (curscroll > 0)
+       if (curscroll > 0) {
+               move(1, 0);
                addch('^');
-       clrtoeol(); /* Clear to end of second line */
+       }
 
        move(2, 0);
 
@@ -5849,8 +5846,6 @@ static void redraw(char *path)
                g_state.dircolor = 0;
        }
 
-       clrtobot(); /* clear to end of screen */
-
        /* Go to first entry */
        if (i < ndents) {
                move(xlines - 2, 0);