mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 11:51:27 +00:00
print_details: printw align
This commit is contained in:
parent
a0be1c33cb
commit
f1f147c928
12
src/nnn.c
12
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)
|
static void print_details(const struct entry *ent)
|
||||||
{
|
{
|
||||||
int entry_type = ent->mode & S_IFMT;
|
int entry_type = ent->mode & S_IFMT;
|
||||||
static const char blanks[9] = " ";
|
|
||||||
|
|
||||||
/* Directories are always shown on top */
|
/* Directories are always shown on top */
|
||||||
resetdircolor(ent->flags);
|
resetdircolor(ent->flags);
|
||||||
|
|
||||||
print_time(&ent->t);
|
print_time(&ent->t);
|
||||||
addstr(blanks + sizeof(blanks) - 3);
|
addstr(" ");
|
||||||
|
|
||||||
/* Permissions */
|
/* Permissions */
|
||||||
addch('0' + ((ent->mode >> 6) & 7));
|
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) {
|
if (entry_type == S_IFREG || entry_type == S_IFDIR) {
|
||||||
char *size = coolsize(cfg.blkorder ? ent->blocks << blk_shift : ent->size);
|
char *size = coolsize(cfg.blkorder ? ent->blocks << blk_shift : ent->size);
|
||||||
addstr(blanks + (uint_t)xstrlen(size) - 1);
|
printw("%*c%s", 9 - (uint_t)xstrlen(size), ' ', size);
|
||||||
addstr(size);
|
} else
|
||||||
} else {
|
printw("%*c%s", 8, ' ', get_detail_ind(ent->mode));
|
||||||
addstr(blanks);
|
|
||||||
addch(get_detail_ind(ent->mode));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void printent_long(const struct entry *ent, uint_t namecols, bool sel)
|
static void printent_long(const struct entry *ent, uint_t namecols, bool sel)
|
||||||
|
|
Loading…
Reference in a new issue