@@ -37,16 +37,20 @@ static const struct icon_pair exec_icon = {"", FA_TERMINAL, 0}; | |||||
/* All entries are case-insensitive */ | /* All entries are case-insensitive */ | ||||
static const struct icon_pair icons_name[] = { | static const struct icon_pair icons_name[] = { | ||||
{".git", FA_GITHUB_SQUARE, 0}, | |||||
{"Desktop", FA_HOME, 0}, | |||||
{"Documents", FA_LIST_ALT, 0}, | |||||
{"Downloads", FA_DOWNLOAD, 0}, | |||||
{"Music", FA_MUSIC, 0}, | |||||
{"node_modules", MFIZZ_NPM, 0}, | |||||
{"Pictures", FA_IMAGE, 0}, | |||||
{"Public", FA_INBOX, 0}, | |||||
{"Templates", FA_COG, 0}, | |||||
{"Videos", FA_FILM, 0}, | |||||
{".git", FA_GITHUB_SQUARE, 0}, | |||||
{"Desktop", FA_HOME, 0}, | |||||
{"Documents", FA_LIST_ALT, 0}, | |||||
{"Downloads", FA_DOWNLOAD, 0}, | |||||
{"Music", FA_MUSIC, 0}, | |||||
{"node_modules", MFIZZ_NPM, 0}, | |||||
{"Pictures", FA_IMAGE, 0}, | |||||
{"Public", FA_INBOX, 0}, | |||||
{"Templates", FA_COG, 0}, | |||||
{"Videos", FA_FILM, 0}, | |||||
{"CHANGELOG", MD_CHANGE_HISTORY, 0}, | |||||
{"configure", FILE_CONFIG, 0}, | |||||
{"License", FA_COPYRIGHT, 0}, | |||||
{"Makefile", FILE_CMAKE, 0}, | |||||
}; | }; | ||||
/* | /* | ||||
@@ -57,6 +61,7 @@ static const struct icon_pair icons_name[] = { | |||||
static const struct icon_pair icons_ext[] = { | static const struct icon_pair icons_ext[] = { | ||||
/* Numbers */ | /* Numbers */ | ||||
{"1", FILE_MANPAGE, 0}, | |||||
{"7z", FA_FILE_ARCHIVE_O, ARCHIVE_COLOR}, | {"7z", FA_FILE_ARCHIVE_O, ARCHIVE_COLOR}, | ||||
/* A */ | /* A */ | ||||
@@ -158,8 +163,9 @@ static const struct icon_pair icons_ext[] = { | |||||
/* M */ | /* M */ | ||||
{"m4a", FA_FILE_AUDIO_O, AUDIO_COLOR}, | {"m4a", FA_FILE_AUDIO_O, AUDIO_COLOR}, | ||||
{"m4v", FA_FILE_MOVIE_O, VIDEO_COLOR}, | {"m4v", FA_FILE_MOVIE_O, VIDEO_COLOR}, | ||||
{"markdown", OCT_MARKDOWN, 0}, | |||||
{"md", OCT_MARKDOWN, 0}, | |||||
{"markdown", DEV_MARKDOWN, 0}, | |||||
{"md", DEV_MARKDOWN, 0}, | |||||
{"mk", FILE_CMAKE, 0}, | |||||
{"mkv", FA_FILE_MOVIE_O, VIDEO_COLOR}, | {"mkv", FA_FILE_MOVIE_O, VIDEO_COLOR}, | ||||
{"mov", FA_FILE_MOVIE_O, VIDEO_COLOR}, | {"mov", FA_FILE_MOVIE_O, VIDEO_COLOR}, | ||||
{"mp3", FA_FILE_AUDIO_O, AUDIO_COLOR}, | {"mp3", FA_FILE_AUDIO_O, AUDIO_COLOR}, | ||||
@@ -687,7 +687,7 @@ static const char * const patterns[] = { | |||||
#ifdef ICONS | #ifdef ICONS | ||||
/* NUMBERS, A-Z, OTHER = 28. */ | /* NUMBERS, A-Z, OTHER = 28. */ | ||||
static ushort icon_positions[28]; | |||||
static ushort icon_positions[37]; | |||||
#endif | #endif | ||||
static char gcolors[] = "c1e2272e006033f7c6d6abc4"; | static char gcolors[] = "c1e2272e006033f7c6d6abc4"; | ||||
@@ -1729,36 +1729,26 @@ static bool initcurses(void *oldmask) | |||||
if (!g_state.oldcolor) { | if (!g_state.oldcolor) { | ||||
uchar icolors[256] = {0}; | uchar icolors[256] = {0}; | ||||
char c; | char c; | ||||
bool found = TRUE; | |||||
memset(icon_positions, 0x7f, sizeof(icon_positions)); | memset(icon_positions, 0x7f, sizeof(icon_positions)); | ||||
if (icons_ext[0].match[0] >= '0' && icons_ext[0].match[0] <= '9') { | |||||
icon_positions[0] = 0; | |||||
if (icons_ext[0].color && !icolors[icons_ext[0].color]) { | |||||
init_pair(C_UND + 1 + icons_ext[0].color, icons_ext[0].color, -1); | |||||
icolors[icons_ext[0].color] = 1; | |||||
} | |||||
} | |||||
for (uint i = 0; i < sizeof(icons_ext)/sizeof(struct icon_pair); ++i) { | for (uint i = 0; i < sizeof(icons_ext)/sizeof(struct icon_pair); ++i) { | ||||
c = TOUPPER(icons_ext[i].match[0]); | c = TOUPPER(icons_ext[i].match[0]); | ||||
if (c >= 'A' && c <= 'Z') { | if (c >= 'A' && c <= 'Z') { | ||||
if (icon_positions[c - 'A' + 1] == 0x7f7f) | |||||
icon_positions[c - 'A' + 1] = i; | |||||
} else if (!(c >= '0' && c <= '9')) { | |||||
if (icon_positions[27] == 0x7f7f) | |||||
icon_positions[27] = i; | |||||
} else | |||||
found = FALSE; | |||||
if (icon_positions[c - 'A' + 10] == 0x7f7f) | |||||
icon_positions[c - 'A' + 10] = i; | |||||
} else if (c >= '0' && c <= '9') { | |||||
if (icon_positions[c - '0'] == 0x7f7f) | |||||
icon_positions[c - '0'] = i; | |||||
} else { | |||||
if (icon_positions[36] == 0x7f7f) | |||||
icon_positions[36] = i; | |||||
} | |||||
if (found) { | |||||
if (icons_ext[i].color && !icolors[icons_ext[i].color]) { | |||||
init_pair(C_UND + 1 + icons_ext[i].color, icons_ext[i].color, -1); | |||||
icolors[icons_ext[i].color] = 1; | |||||
} | |||||
} else | |||||
found = TRUE; | |||||
if (icons_ext[i].color && !icolors[icons_ext[i].color]) { | |||||
init_pair(C_UND + 1 + icons_ext[i].color, icons_ext[i].color, -1); | |||||
icolors[icons_ext[i].color] = 1; | |||||
} | |||||
} | } | ||||
} | } | ||||
#endif | #endif | ||||
@@ -3499,11 +3489,11 @@ static const struct icon_pair * get_icon(const struct entry *ent){ | |||||
++tmp; | ++tmp; | ||||
if (*tmp >= '0' && *tmp <= '9') | if (*tmp >= '0' && *tmp <= '9') | ||||
i = 0; /* NUMBER */ | |||||
i = *tmp - '0'; /* NUMBER */ | |||||
else if (TOUPPER(*tmp) >= 'A' && TOUPPER(*tmp) <= 'Z') | else if (TOUPPER(*tmp) >= 'A' && TOUPPER(*tmp) <= 'Z') | ||||
i = TOUPPER(*tmp) - 'A' + 1; /* LETTER A-Z */ | |||||
i = TOUPPER(*tmp) - 'A' + 10; /* LETTER A-Z */ | |||||
else | else | ||||
i = 27; /* OTHER */ | |||||
i = 36; /* OTHER */ | |||||
for (j = icon_positions[i]; j < sizeof(icons_ext)/sizeof(struct icon_pair) && | for (j = icon_positions[i]; j < sizeof(icons_ext)/sizeof(struct icon_pair) && | ||||
icons_ext[j].match[0] == icons_ext[icon_positions[i]].match[0]; ++j) | icons_ext[j].match[0] == icons_ext[icon_positions[i]].match[0]; ++j) | ||||