From f1f147c9282fb35dca5260f7d08c153c84f12620 Mon Sep 17 00:00:00 2001 From: Luuk van Baal Date: Wed, 7 Apr 2021 23:00:48 +0200 Subject: [PATCH 1/2] print_details: printw align --- src/nnn.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/nnn.c b/src/nnn.c index e69cc150..5cd6e236 100644 --- 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%s", 8, ' ', get_detail_ind(ent->mode)); } static void printent_long(const struct entry *ent, uint_t namecols, bool sel) From ada4695bb614154e46e8c6e5f2079f1cdbf7cd35 Mon Sep 17 00:00:00 2001 From: Luuk van Baal Date: Wed, 7 Apr 2021 23:10:12 +0200 Subject: [PATCH 2/2] ind to char --- src/nnn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nnn.c b/src/nnn.c index 5cd6e236..140be25e 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -3747,7 +3747,7 @@ static void print_details(const struct entry *ent) char *size = coolsize(cfg.blkorder ? ent->blocks << blk_shift : ent->size); printw("%*c%s", 9 - (uint_t)xstrlen(size), ' ', size); } else - printw("%*c%s", 8, ' ', get_detail_ind(ent->mode)); + printw("%*c%c", 8, ' ', get_detail_ind(ent->mode)); } static void printent_long(const struct entry *ent, uint_t namecols, bool sel)