From 76675f629801c394a7052c3436d150c089e70ca6 Mon Sep 17 00:00:00 2001 From: Andy Williams Date: Tue, 21 Oct 2014 14:26:01 +0100 Subject: [PATCH] Use the recommended formatting for colour, avoid font weight right now as it doesn't stack properly --- src/bin/editor/edi_editor.c | 40 ++++++++++++++++--------------------- 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/src/bin/editor/edi_editor.c b/src/bin/editor/edi_editor.c index 1e3139e..19e3016 100644 --- a/src/bin/editor/edi_editor.c +++ b/src/bin/editor/edi_editor.c @@ -22,22 +22,22 @@ #define Edi_Color const char * -static Edi_Color EDI_COLOR_FOREGROUND = "+ color=#ffffff"; -static Edi_Color EDI_COLOR_COMMENT = "+ color=#3399ff"; -static Edi_Color EDI_COLOR_STRING = "+ color=#ff3a35"; -static Edi_Color EDI_COLOR_NUMBER = "+ color=#D4D42A font_weight=Bold"; -static Edi_Color EDI_COLOR_BRACE = "+ color=#656565"; -static Edi_Color EDI_COLOR_TYPE = "+ color=#3399ff"; -static Edi_Color EDI_COLOR_CLASS = "+ color=#72AAD4 font_weight=Bold"; -static Edi_Color EDI_COLOR_FUNCTION = "+ color=#72AAD4 font_weight=Bold"; -static Edi_Color EDI_COLOR_PARAM = "+ color=#ffffff"; -static Edi_Color EDI_COLOR_KEYWORD = "+ color=#ff9900 font_weight=Bold"; -static Edi_Color EDI_COLOR_PREPROCESSOR = "+ color=#00B000"; +static Edi_Color EDI_COLOR_FOREGROUND = ""; +static Edi_Color EDI_COLOR_COMMENT = ""; +static Edi_Color EDI_COLOR_STRING = ""; +static Edi_Color EDI_COLOR_NUMBER = "";// font_weight=Bold"; +static Edi_Color EDI_COLOR_BRACE = ""; +static Edi_Color EDI_COLOR_TYPE = ""; +static Edi_Color EDI_COLOR_CLASS = "";// font_weight=Bold"; +static Edi_Color EDI_COLOR_FUNCTION = "";// font_weight=Bold"; +static Edi_Color EDI_COLOR_PARAM = ""; +static Edi_Color EDI_COLOR_KEYWORD = "";// font_weight=Bold"; +static Edi_Color EDI_COLOR_PREPROCESSOR = ""; -static Edi_Color EDI_COLOR_BACKGROUND = "+ backing_color=#000000"; -static Edi_Color EDI_COLOR_SEVIRITY_IGNORED = "+ backing_color=#000000"; -static Edi_Color EDI_COLOR_SEVIRITY_NOTE = "+ backing_color=#ff9900"; -static Edi_Color EDI_COLOR_SEVIRITY_WARNING = "+ backing_color=#ff9900"; +static Edi_Color EDI_COLOR_BACKGROUND = "+"; +static Edi_Color EDI_COLOR_SEVIRITY_IGNORED = ""; +static Edi_Color EDI_COLOR_SEVIRITY_NOTE = ""; +static Edi_Color EDI_COLOR_SEVIRITY_WARNING = ""; typedef struct { @@ -280,19 +280,13 @@ _edi_editor_statusbar_add(Evas_Object *panel, Edi_Editor *editor, Edi_Mainview_I static void _edi_range_color_set(Edi_Editor *editor, Edi_Range range, Edi_Color color) { - char *format; - format = strdup(color); - evas_textblock_cursor_line_set(_format_cursor, range.start.line - 1); evas_textblock_cursor_pos_set(_format_cursor, evas_textblock_cursor_pos_get(_format_cursor) + range.start.col - 1); - evas_textblock_cursor_format_prepend(_format_cursor, format); + evas_textblock_cursor_format_prepend(_format_cursor, color); - format[0] = '-'; evas_textblock_cursor_line_set(_format_cursor, range.end.line - 1); evas_textblock_cursor_pos_set(_format_cursor, evas_textblock_cursor_pos_get(_format_cursor) + range.end.col - 1); - evas_textblock_cursor_format_append(_format_cursor, format); - - free(format); + evas_textblock_cursor_format_append(_format_cursor, ""); } static void