aboutsummaryrefslogtreecommitdiffstats
path: root/src/nnn.c
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-09-15 18:14:56 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-09-15 18:14:56 +0530
commit6feaecafe2f576f3b67c8c67fc22df9115790701 (patch)
treec691cb8eb2f43cd56f111481c3ff5259f1e5677f /src/nnn.c
parent9afe09b4b5df036d16738e506246d6ae0512bdd3 (diff)
downloadnnn-6feaecafe2f576f3b67c8c67fc22df9115790701.tar.gz
An extra column when no indicator
Diffstat (limited to 'src/nnn.c')
-rw-r--r--src/nnn.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/nnn.c b/src/nnn.c
index 1b5041e..0fca4d7 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -2332,7 +2332,6 @@ static char *get_lsperms(mode_t mode)
static void printent(const struct entry *ent, int sel, uint namecols)
{
wchar_t *wstr;
- unescape(ent->name, namecols, &wstr);
char ind = '\0';
switch (ent->mode & S_IFMT) {
@@ -2360,6 +2359,11 @@ static void printent(const struct entry *ent, int sel, uint namecols)
break;
}
+ if (!ind)
+ ++namecols;
+
+ unescape(ent->name, namecols, &wstr);
+
/* Directories are always shown on top */
resetdircolor(ent->flags);
@@ -2390,6 +2394,10 @@ static void printent_long(const struct entry *ent, int sel, uint namecols)
permbuf[2] = '0' + (ent->mode & 7);
permbuf[3] = '\0';
+ /* Add a column if no indicator is needed */
+ if (S_ISREG(ent->mode) && !(ent->mode & 0100))
+ ++namecols;
+
/* Trim escape chars from name */
const char *pname = unescape(ent->name, namecols, NULL);