Ticket #1785: fix of editor default color usage.
(this_try_alloc_color_pair): if foreground and background editor colors are undefined in syntax, the NORMAL_COLOR is used. This is wrong. EDITOR_NORMAL_COLOR mut be used instead. (edit_status): cleanup: remove useless color change. Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Этот коммит содержится в:
родитель
b537fcc5a9
Коммит
7f119ffbbc
@ -207,7 +207,6 @@ edit_status (WEdit * edit)
|
||||
widget_move (edit, 0, edit->widget.cols - 5);
|
||||
tty_printf (" %3d%%", percent);
|
||||
}
|
||||
tty_setcolor (EDITOR_NORMAL_COLOR);
|
||||
|
||||
g_free (status);
|
||||
}
|
||||
|
@ -744,6 +744,10 @@ this_try_alloc_color_pair (const char *fg, const char *bg)
|
||||
bg = NULL;
|
||||
if (fg != NULL && *fg == '\0')
|
||||
fg = NULL;
|
||||
|
||||
if ((fg == NULL) && (bg == NULL))
|
||||
return EDITOR_NORMAL_COLOR;
|
||||
|
||||
if (fg != NULL)
|
||||
{
|
||||
g_strlcpy (f, fg, sizeof (f));
|
||||
@ -760,6 +764,36 @@ this_try_alloc_color_pair (const char *fg, const char *bg)
|
||||
*p = '\0';
|
||||
bg = b;
|
||||
}
|
||||
if ((fg == NULL) || (bg == NULL))
|
||||
{
|
||||
/* get colors from skin */
|
||||
char *editnormal;
|
||||
|
||||
editnormal = mc_skin_get ("editor", "_default_", "default;default");
|
||||
|
||||
if (fg == NULL)
|
||||
{
|
||||
g_strlcpy (f, editnormal, sizeof (f));
|
||||
p = strchr (f, ';');
|
||||
if (p != NULL)
|
||||
*p = '\0';
|
||||
if (f[0] == '\0')
|
||||
g_strlcpy (f, "default", sizeof (f));
|
||||
fg = f;
|
||||
}
|
||||
if (bg == NULL)
|
||||
{
|
||||
p = strchr (editnormal, ';');
|
||||
if ((p != NULL) && (*(++p) != '\0'))
|
||||
g_strlcpy (b, p, sizeof (b));
|
||||
else
|
||||
g_strlcpy (b, "default", sizeof (b));
|
||||
bg = b;
|
||||
}
|
||||
|
||||
g_free (editnormal);
|
||||
}
|
||||
|
||||
return tty_try_alloc_color_pair (fg, bg);
|
||||
}
|
||||
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user