nnn

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

commit 9a73057272a8979a51aa0ece8f9315f06a7b2dd4
parent dc9d877941f18eaa6d2235ae454407a983cc1740
Author: Mischievous Meerkat <engineerarun@gmail.com>
Date:   Thu,  8 Apr 2021 02:55:53 +0530

Merge pull request #939 from luukvbaal/printw

print_details: printw align
Diffstat:
Msrc/nnn.c | 12++++--------
1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/src/nnn.c b/src/nnn.c @@ -3731,13 +3731,12 @@ 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; - static const char blanks[9] = " "; /* Directories are always shown on top */ resetdircolor(ent->flags); print_time(&ent->t); - addstr(blanks + sizeof(blanks) - 3); + addstr(" "); /* Permissions */ addch('0' + ((ent->mode >> 6) & 7)); @@ -3746,12 +3745,9 @@ static void print_details(const struct entry *ent) if (entry_type == S_IFREG || entry_type == S_IFDIR) { char *size = coolsize(cfg.blkorder ? ent->blocks << blk_shift : ent->size); - addstr(blanks + (uint_t)xstrlen(size) - 1); - addstr(size); - } else { - addstr(blanks); - addch(get_detail_ind(ent->mode)); - } + printw("%*c%s", 9 - (uint_t)xstrlen(size), ' ', size); + } else + printw("%*c%c", 8, ' ', get_detail_ind(ent->mode)); } static void printent_long(const struct entry *ent, uint_t namecols, bool sel)