aboutsummaryrefslogtreecommitdiffstats
path: root/src/nnn.c
diff options
context:
space:
mode:
authorGravatar Dave Snider <dave.snider@gmail.com>2020-09-13 19:59:51 -0700
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-09-14 22:09:52 +0530
commit1fc1b8be8b6cd5d43f7443486dc97cce133f9053 (patch)
treeec51471e9709dab8a850574fbf040bab4a2d509c /src/nnn.c
parent868c1898d36c90b56082d350821c6c95e37e43ca (diff)
downloadnnn-1fc1b8be8b6cd5d43f7443486dc97cce133f9053.tar.gz
Add nerdfont defs file and normalize vars (#722)
* Add nerdfont defs file and normalize vars * some cleanup * address feedback * one more spacing issue * address feedback
Diffstat (limited to 'src/nnn.c')
-rw-r--r--src/nnn.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/nnn.c b/src/nnn.c
index 5b307fd..8de6021 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -112,8 +112,9 @@
#include "nnn.h"
#include "dbg.h"
-#ifdef ICONS
+#if defined(ICONS) || defined(NERD)
#include "icons.h"
+#define ICONS_ENABLED
#endif
#ifdef TOURBIN_QSORT
@@ -691,7 +692,7 @@ static const char * const patterns[] = {
#define C_SOC (C_PIP + 1) /* Socket: MediumOrchid1 */
#define C_UND (C_SOC + 1) /* Unknown OR 0B regular/exe file: Red1 */
-#ifdef ICONS
+#ifdef ICONS_ENABLED
/* 0-9, A-Z, OTHER = 36. */
static ushort icon_positions[37];
#endif
@@ -1739,7 +1740,7 @@ static bool initcurses(void *oldmask)
}
}
-#ifdef ICONS
+#ifdef ICONS_ENABLED
if (!g_state.oldcolor) {
uchar icolors[256] = {0};
char c;
@@ -3480,7 +3481,7 @@ static char *get_lsperms(mode_t mode)
return bits;
}
-#ifdef ICONS
+#ifdef ICONS_ENABLED
static const struct icon_pair * get_icon(const struct entry *ent){
ushort i = 0;
@@ -3626,7 +3627,7 @@ static void printent(const struct entry *ent, uint namecols, bool sel)
addch((ent->flags & FILE_SELECTED) ? '+' : ' ');
-#ifdef ICONS
+#ifdef ICONS_ENABLED
if (!g_state.oldcolor)
print_icon(ent, attrs);
#endif
@@ -3758,7 +3759,7 @@ static void printent_long(const struct entry *ent, uint namecols, bool sel)
attrs ^= A_DIM;
}
} else {
-#ifndef ICONS
+#ifndef ICONS_ENABLED
addstr(" ");
#endif
if (ent->flags & FILE_MISSING)
@@ -3770,7 +3771,7 @@ static void printent_long(const struct entry *ent, uint namecols, bool sel)
if (pair && fcolors[pair])
attrs |= COLOR_PAIR(pair);
-#ifdef ICONS
+#ifdef ICONS_ENABLED
attroff(attrs);
addstr(" ");
if (sel)
@@ -5573,7 +5574,7 @@ static int adjust_cols(int ncols)
}
/* 3 = Preceding space, indicator, newline */
-#ifdef ICONS
+#ifdef ICONS_ENABLED
ncols -= 3 + xstrlen(ICON_PADDING_LEFT) + xstrlen(ICON_PADDING_RIGHT) + 1;
#else
ncols -= 3;