mirror of
https://github.com/jarun/nnn.git
synced 2025-01-26 02:36:36 +00:00
Reverse only hovered file name in detail mode
Changes: - reverse only the file name in detail view - don't apply reverse to details, show an arrow to the left - always show selection ('+' symbol) in bright - delegate showing selection '+' to printent()
This commit is contained in:
parent
dd5588650d
commit
b0fd7a5ffe
18
src/nnn.c
18
src/nnn.c
|
@ -3686,12 +3686,10 @@ static void printent_long(const struct entry *ent, uint_t namecols, bool sel);
|
||||||
|
|
||||||
static void printent(const struct entry *ent, uint_t namecols, bool sel)
|
static void printent(const struct entry *ent, uint_t namecols, bool sel)
|
||||||
{
|
{
|
||||||
bool detailed = (printptr == &printent_long);
|
uchar_t color_pair = get_color_pair(ent, (printptr == &printent_long));
|
||||||
uchar_t color_pair = get_color_pair(ent, detailed);
|
|
||||||
char ind = get_name_ind(ent);
|
char ind = get_name_ind(ent);
|
||||||
int attrs = 0;
|
int attrs = 0;
|
||||||
|
|
||||||
if (!detailed)
|
|
||||||
addch((ent->flags & FILE_SELECTED) ? '+' : ' ');
|
addch((ent->flags & FILE_SELECTED) ? '+' : ' ');
|
||||||
|
|
||||||
/* Directories are always shown on top */
|
/* Directories are always shown on top */
|
||||||
|
@ -3775,22 +3773,14 @@ static void print_details(const struct entry *ent)
|
||||||
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)
|
||||||
{
|
{
|
||||||
int attrs1 = g_state.oldcolor ? A_DIM : COLOR_PAIR(C_MIS);
|
int attrs1 = g_state.oldcolor ? A_DIM : COLOR_PAIR(C_MIS);
|
||||||
int attrs2 = sel ? A_REVERSE : 0;
|
|
||||||
|
|
||||||
addch(' ');
|
addch(sel ? '>' : ' ');
|
||||||
attron(attrs1 | attrs2);
|
attron(attrs1);
|
||||||
print_details(ent);
|
print_details(ent);
|
||||||
|
|
||||||
#ifdef ICONS_ENABLED
|
|
||||||
if (!g_state.oldcolor)
|
|
||||||
attroff(attrs2);
|
|
||||||
#endif
|
|
||||||
addch(' ');
|
|
||||||
if (!sel)
|
|
||||||
attroff(attrs1);
|
attroff(attrs1);
|
||||||
addch((ent->flags & FILE_SELECTED) ? '+' : ' ');
|
addch(' ');
|
||||||
|
|
||||||
attroff(attrs1 | attrs2);
|
|
||||||
printent(ent, namecols, sel);
|
printent(ent, namecols, sel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue