浏览代码

Revert "Remove bold fonts"

This reverts commit 43762d58c5.
master
Arun Prakash Jana 5 年前
父节点
当前提交
9d4498e7b3
共有 1 个文件被更改,包括 7 次插入13 次删除
  1. +7
    -13
      src/nnn.c

+ 7
- 13
src/nnn.c 查看文件

@@ -932,7 +932,6 @@ static void resetcpind(void)
static bool initcurses(void) static bool initcurses(void)
{ {
short i; short i;
uchar mask = 8; /* Use bright colors */


if (cfg.picker) { if (cfg.picker) {
if (!newterm(NULL, stderr, stdin)) { if (!newterm(NULL, stderr, stdin)) {
@@ -964,13 +963,9 @@ static bool initcurses(void)
start_color(); start_color();
use_default_colors(); use_default_colors();


/* Handle 8-bit color terms */
if (COLOR_PAIRS != 256)
mask = 0;

/* Initialize default colors */ /* Initialize default colors */
for (i = 0; i < CTX_MAX; ++i) for (i = 0; i < CTX_MAX; ++i)
init_pair(i + 1, g_ctx[i].color | mask, -1);
init_pair(i + 1, g_ctx[i].color, -1);


settimeout(); /* One second */ settimeout(); /* One second */
set_escdelay(25); set_escdelay(25);
@@ -2185,7 +2180,7 @@ static char *get_bm_loc(char *buf, int key)
static inline void resetdircolor(int flags) static inline void resetdircolor(int flags)
{ {
if (cfg.dircolor && !(flags & DIR_OR_LINK_TO_DIR)) { if (cfg.dircolor && !(flags & DIR_OR_LINK_TO_DIR)) {
attroff(COLOR_PAIR(cfg.curctx + 1));
attroff(COLOR_PAIR(cfg.curctx + 1) | A_BOLD);
cfg.dircolor = 0; cfg.dircolor = 0;
} }
} }
@@ -3221,14 +3216,14 @@ static void redraw(char *path)
if (!g_ctx[i].c_cfg.ctxactive) if (!g_ctx[i].c_cfg.ctxactive)
printw("%d ", i + 1); printw("%d ", i + 1);
else if (cfg.curctx != i) { else if (cfg.curctx != i) {
attrs = COLOR_PAIR(i + 1) | A_UNDERLINE;
attrs = COLOR_PAIR(i + 1) | A_BOLD | A_UNDERLINE;
attron(attrs); attron(attrs);
printw("%d", i + 1); printw("%d", i + 1);
attroff(attrs); attroff(attrs);
printw(" "); printw(" ");
} else { } else {
/* Print current context in reverse */ /* Print current context in reverse */
attrs = COLOR_PAIR(i + 1) | A_REVERSE;
attrs = COLOR_PAIR(i + 1) | A_BOLD | A_REVERSE;
attron(attrs); attron(attrs);
printw("%d", i + 1); printw("%d", i + 1);
attroff(attrs); attroff(attrs);
@@ -3259,7 +3254,7 @@ static void redraw(char *path)
ncols -= 5; ncols -= 5;


if (!cfg.wild) { if (!cfg.wild) {
attron(COLOR_PAIR(cfg.curctx + 1));
attron(COLOR_PAIR(cfg.curctx + 1) | A_BOLD);
cfg.dircolor = 1; cfg.dircolor = 1;
} }


@@ -3270,7 +3265,7 @@ static void redraw(char *path)


/* Must reset e.g. no files in dir */ /* Must reset e.g. no files in dir */
if (cfg.dircolor) { if (cfg.dircolor) {
attroff(COLOR_PAIR(cfg.curctx + 1));
attroff(COLOR_PAIR(cfg.curctx + 1) | A_BOLD);
cfg.dircolor = 0; cfg.dircolor = 0;
} }


@@ -4722,7 +4717,6 @@ int main(int argc, char *argv[])
/* Get the context colors; copier used as tmp var */ /* Get the context colors; copier used as tmp var */
copier = xgetenv(env_cfg[NNN_CONTEXT_COLORS], "4444"); copier = xgetenv(env_cfg[NNN_CONTEXT_COLORS], "4444");
opt = 0; opt = 0;

while (opt < CTX_MAX) { while (opt < CTX_MAX) {
if (*copier) { if (*copier) {
if (*copier < '0' || *copier > '7') { if (*copier < '0' || *copier > '7') {
@@ -4730,7 +4724,7 @@ int main(int argc, char *argv[])
return _FAILURE; return _FAILURE;
} }


g_ctx[opt].color = (*copier - '0');
g_ctx[opt].color = *copier - '0';
++copier; ++copier;
} else } else
g_ctx[opt].color = 4; g_ctx[opt].color = 4;


正在加载...
取消
保存