Merge pull request #1038 from luukvbaal/unicodearrows

Unicode arrow indicators for O_ICONS/NERD
This commit is contained in:
Piña Colada 2021-05-31 23:02:44 +05:30 committed by GitHub
commit 6f862131e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 0 deletions

View file

@ -4,6 +4,11 @@
// You can find hex codes for nerd fonts here // You can find hex codes for nerd fonts here
// https://www.nerdfonts.com/cheat-sheet // https://www.nerdfonts.com/cheat-sheet
// Arrows
#define MD_ARROW_UPWARD "\uf55c"
#define MD_ARROW_FORWARD "\uf553"
#define MD_ARROW_DOWNWARD "\uf544"
// Generics // Generics
#define ICON_DIRECTORY "\ue5ff" #define ICON_DIRECTORY "\ue5ff"
#define ICON_FILE "\uf713" #define ICON_FILE "\uf713"

View file

@ -5781,7 +5781,11 @@ static void statusbar(char *path)
if (i > 1) { /* Show symlink target */ if (i > 1) { /* Show symlink target */
g_buf[i] = '\0'; g_buf[i] = '\0';
#ifdef ICONS_ENABLED
addstr(" "MD_ARROW_FORWARD);
#else
addstr(" ->"); addstr(" ->");
#endif
addstr(g_buf); addstr(g_buf);
} }
} else { } else {
@ -5814,7 +5818,11 @@ static inline void markhovered(void)
{ {
if (cfg.showdetail && ndents) { /* Reversed block for hovered entry */ if (cfg.showdetail && ndents) { /* Reversed block for hovered entry */
tocursor(); tocursor();
#ifdef ICONS_ENABLED
addstr(MD_ARROW_FORWARD);
#else
addch(' ' | A_REVERSE); addch(' ' | A_REVERSE);
#endif
} }
} }
@ -5967,7 +5975,11 @@ static void redraw(char *path)
/* Go to first entry */ /* Go to first entry */
if (curscroll > 0) { if (curscroll > 0) {
move(1, 0); move(1, 0);
#ifdef ICONS_ENABLED
addstr(MD_ARROW_UPWARD);
#else
addch('^'); addch('^');
#endif
} }
if (g_state.oldcolor) { if (g_state.oldcolor) {
@ -5992,7 +6004,11 @@ static void redraw(char *path)
/* Go to last entry */ /* Go to last entry */
if (onscreen < ndents) { if (onscreen < ndents) {
move(xlines - 2, 0); move(xlines - 2, 0);
#ifdef ICONS_ENABLED
addstr(MD_ARROW_DOWNWARD);
#else
addch('v'); addch('v');
#endif
} }
markhovered(); markhovered();