aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-03-05 00:24:58 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-03-08 04:49:43 +0530
commit197bedc6ffee25877f8c01a4dd8766fd249f429d (patch)
tree238ccbb67410ec876fca0e64c1942b3c7188f702
parentb2aea5c619ec6bf56a6bf7d3020dc0fde4426c5e (diff)
downloadnnn-197bedc6ffee25877f8c01a4dd8766fd249f429d.tar.gz
Show selection in light mode
-rw-r--r--src/nnn.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/nnn.c b/src/nnn.c
index 4c66529..9b76fe2 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -171,8 +171,8 @@ disabledbg()
#define TOUPPER(ch) \
(((ch) >= 'a' && (ch) <= 'z') ? ((ch) - 'a' + 'A') : (ch))
#define CMD_LEN_MAX (PATH_MAX + ((NAME_MAX + 1) << 1))
-#define CURSR " > "
-#define EMPTY " "
+#define CURSR " >"
+#define EMPTY " "
#define CURSYM(flag) ((flag) ? CURSR : EMPTY)
#define FILTER '/'
#define REGEX_MAX 128
@@ -2134,16 +2134,18 @@ static char *get_file_sym(mode_t mode)
static void printent(const struct entry *ent, int sel, uint namecols)
{
const char *pname = unescape(ent->name, namecols);
+ const char cp = (ent->flags & FILE_COPIED) ? '+' : ' ';
/* Directories are always shown on top */
resetdircolor(ent->flags);
- printw("%s%s%s\n", CURSYM(sel), pname, get_file_sym(ent->mode));
+ printw("%s%c%s%s\n", CURSYM(sel), cp, pname, get_file_sym(ent->mode));
}
static void printent_long(const struct entry *ent, int sel, uint namecols)
{
- char timebuf[18], permbuf[4], ind1 = '\0', ind2[] = "\0\0", cp = ' ';
+ char timebuf[18], permbuf[4], ind1 = '\0', ind2[] = "\0\0";
+ const char cp = (ent->flags & FILE_COPIED) ? '+' : ' ';
/* Timestamp */
strftime(timebuf, 18, "%F %R", localtime(&ent->t));
@@ -2157,10 +2159,6 @@ static void printent_long(const struct entry *ent, int sel, uint namecols)
permbuf[2] = permbuf[2] ? permbuf[2] : '0';
permbuf[3] = '\0';
- /* Add copy indicator */
- if (ent->flags & FILE_COPIED)
- cp = '+';
-
/* Trim escape chars from name */
const char *pname = unescape(ent->name, namecols);