mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 11:51:27 +00:00
Minor reformat
This commit is contained in:
parent
a85467d462
commit
d86810a425
2
Makefile
2
Makefile
|
@ -19,7 +19,7 @@ O_NOMOUSE := 0 # no mouse support
|
||||||
O_NOBATCH := 0 # no built-in batch renamer
|
O_NOBATCH := 0 # no built-in batch renamer
|
||||||
O_NOFIFO := 0 # no FIFO previewer support
|
O_NOFIFO := 0 # no FIFO previewer support
|
||||||
O_CTX8 := 0 # enable 8 contexts
|
O_CTX8 := 0 # enable 8 contexts
|
||||||
O_ICONS := 0 # support icons
|
O_ICONS := 0 # support icons
|
||||||
|
|
||||||
# convert targets to flags for backwards compatibility
|
# convert targets to flags for backwards compatibility
|
||||||
ifneq ($(filter debug,$(MAKECMDGOALS)),)
|
ifneq ($(filter debug,$(MAKECMDGOALS)),)
|
||||||
|
|
|
@ -17,7 +17,7 @@ O_NOMOUSE := 0 # no mouse support
|
||||||
O_NOBATCH := 0 # no built-in batch renamer
|
O_NOBATCH := 0 # no built-in batch renamer
|
||||||
O_NOFIFO := 0 # no FIFO previewer support
|
O_NOFIFO := 0 # no FIFO previewer support
|
||||||
O_CTX8 := 0 # enable 8 contexts
|
O_CTX8 := 0 # enable 8 contexts
|
||||||
O_ICONS := 0 # support icons
|
O_ICONS := 0 # support icons
|
||||||
|
|
||||||
# convert targets to flags for backwards compatibility
|
# convert targets to flags for backwards compatibility
|
||||||
ifneq ($(filter debug,$(MAKECMDGOALS)),)
|
ifneq ($(filter debug,$(MAKECMDGOALS)),)
|
||||||
|
|
|
@ -3,10 +3,10 @@
|
||||||
struct icon_pair {
|
struct icon_pair {
|
||||||
const char *match;
|
const char *match;
|
||||||
const char *icon;
|
const char *icon;
|
||||||
const unsigned char color;
|
const unsigned char color; /* Hex xterm 256 color code, 0 to follow file specific */
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Define a string to be printed before and after the icon
|
* Define a string to be printed before and after the icon
|
||||||
* Adjust if the icons are not printed properly
|
* Adjust if the icons are not printed properly
|
||||||
*/
|
*/
|
||||||
|
@ -38,7 +38,7 @@ static const struct icon_pair icons_name[] = {
|
||||||
{"Videos", FA_FILM, 0},
|
{"Videos", FA_FILM, 0},
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* New entries should bu added such that the first character of the extension is in the correct group .
|
* New entries should bu added such that the first character of the extension is in the correct group .
|
||||||
* This is done for performance reason so that the correct icon can be found faster.
|
* This is done for performance reason so that the correct icon can be found faster.
|
||||||
* All entries are case-insensitive
|
* All entries are case-insensitive
|
||||||
|
@ -93,7 +93,7 @@ static const struct icon_pair icons_ext[] = {
|
||||||
{"elf", FA_LINUX, 0},
|
{"elf", FA_LINUX, 0},
|
||||||
{"epub", FA_FILE_PDF_O, 0},
|
{"epub", FA_FILE_PDF_O, 0},
|
||||||
{"exe", FA_WINDOWS, 0},
|
{"exe", FA_WINDOWS, 0},
|
||||||
|
|
||||||
/* F */
|
/* F */
|
||||||
{"f#", DEV_FSHARP, 0},
|
{"f#", DEV_FSHARP, 0},
|
||||||
{"flac", FA_FILE_AUDIO_O, 0},
|
{"flac", FA_FILE_AUDIO_O, 0},
|
||||||
|
|
|
@ -3482,10 +3482,9 @@ static const char *get_icon(const struct entry *ent){
|
||||||
i = 27; /* OTHER */
|
i = 27; /* 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)
|
||||||
if (strcasecmp(tmp, icons_ext[j].match) == 0)
|
if (strcasecmp(tmp, icons_ext[j].match) == 0)
|
||||||
return icons_ext[j].icon;
|
return icons_ext[j].icon;
|
||||||
}
|
|
||||||
|
|
||||||
return file_icon.icon;
|
return file_icon.icon;
|
||||||
}
|
}
|
||||||
|
@ -3582,7 +3581,7 @@ static void printent(const struct entry *ent, uint namecols, bool sel)
|
||||||
addstr(ICON_PADDING_LEFT);
|
addstr(ICON_PADDING_LEFT);
|
||||||
addstr(get_icon(ent));
|
addstr(get_icon(ent));
|
||||||
addstr(ICON_PADDING_RIGHT);
|
addstr(ICON_PADDING_RIGHT);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef NOLOCALE
|
#ifndef NOLOCALE
|
||||||
|
|
Loading…
Reference in a new issue