]> Sergey Matveev's repositories - nnn.git/commitdiff
Get rid of printw()
authorArun Prakash Jana <engineerarun@gmail.com>
Wed, 26 Feb 2020 15:19:20 +0000 (20:49 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Wed, 26 Feb 2020 15:19:20 +0000 (20:49 +0530)
src/nnn.c

index 8abeff52c8a80396005d9726e762ca9cae73ed39..6eac2c12cc7f56f2d716d3c5ec564d577bd15755 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -3173,6 +3173,8 @@ static void printent(const struct entry *ent, uint namecols, bool sel)
 static void printent_long(const struct entry *ent, uint namecols, bool sel)
 {
        char timebuf[18], permbuf[8], ind1 = '\0', ind2 = '\0', special = '\0';
+       size_t len;
+       char *size;
 
        /* Timestamp */
        strftime(timebuf, sizeof(timebuf), "%F %R", localtime(&ent->t));
@@ -3211,7 +3213,11 @@ static void printent_long(const struct entry *ent, uint namecols, bool sel)
                        ind2 = '/';
                }
 
-               printw("%8.8s", coolsize(cfg.blkorder ? ent->blocks << blk_shift : ent->size));
+               size = coolsize(cfg.blkorder ? ent->blocks << blk_shift : ent->size);
+               len = 9 - strlen(size);
+               while (--len)
+                       addch(' ');
+               addstr(size);
                break;
        case S_IFLNK:
                ind1 = ind2 = '@'; // fallthrough