]> Sergey Matveev's repositories - nnn.git/commitdiff
Reduce checks in per-entry print loop
authorArun Prakash Jana <engineerarun@gmail.com>
Fri, 14 May 2021 03:56:58 +0000 (09:26 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Fri, 14 May 2021 05:55:38 +0000 (11:25 +0530)
src/nnn.c

index bd4d344514b03f4b2c9dc2ec0ac27540483a05f8..689582f6ebbce2b3b8bc850659b3a8660a2569b6 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -3765,8 +3765,7 @@ static void printent(const struct entry *ent, uint_t namecols, bool sel)
                                (char)('0' + ((ent->mode >> 3) & 7)),
                                (char)('0' + (ent->mode & 7)), '\0'};
 
-               addch(sel ? ' ' | A_REVERSE : ' '); /* Reversed block for hovered entry */
-
+               addch(' ');
                attrs = g_state.oldcolor ? (resetdircolor(ent->flags), A_DIM)
                                         : (fcolors[C_MIS] ? COLOR_PAIR(C_MIS) : 0);
                if (attrs)
@@ -5778,6 +5777,11 @@ static void draw_line(char *path, int ncols)
        if (dir)
                attroff(COLOR_PAIR(cfg.curctx + 1) | A_BOLD);
 
+       if (cfg.showdetail) { /* Reversed block for hovered entry */
+               tocursor();
+               addch(' ' | A_REVERSE);
+       }
+
        statusbar(path);
 }
 
@@ -5900,6 +5904,11 @@ static void redraw(char *path)
                addch('v');
        }
 
+       if (cfg.showdetail) { /* Reversed block for hovered entry */
+               tocursor();
+               addch(' ' | A_REVERSE);
+       }
+
        statusbar(path);
 }