nnn

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 0c55e74fb5a776ffdb65551a94c7a160862b6f4b
parent ee04215d9112a6d53c0346beba720af510de102a
Author: Arun Prakash Jana <engineerarun@gmail.com>
Date:   Sun, 11 Apr 2021 04:15:13 +0530

Minor refactor

Diffstat:
Msrc/nnn.c | 10++++------
1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/nnn.c b/src/nnn.c @@ -3715,20 +3715,18 @@ static void printent(const struct entry *ent, uint_t namecols, bool sel) static void print_details(const struct entry *ent) { int entry_type = ent->mode & S_IFMT; + char perms[6] = {' ', ' ', (char)('0' + ((ent->mode >> 6) & 7)), + (char)('0' + ((ent->mode >> 3) & 7)), (char)('0' + (ent->mode & 7)), '\0'}; /* Directories are always shown on top */ resetdircolor(ent->flags); print_time(&ent->t); - addstr(" "); - - /* Permissions */ - addch('0' + ((ent->mode >> 6) & 7)); - addch('0' + ((ent->mode >> 3) & 7)); - addch('0' + (ent->mode & 7)); + addstr(perms); if (entry_type == S_IFREG || entry_type == S_IFDIR) { char *size = coolsize(cfg.blkorder ? ent->blocks << blk_shift : ent->size); + printw("%*c%s", 9 - (uint_t)xstrlen(size), ' ', size); } else printw("%*c%c", 8, ' ', get_detail_ind(ent->mode));