diff --git a/src/lib/edc_editor.c b/src/lib/edc_editor.c index 85aca85..92a0112 100644 --- a/src/lib/edc_editor.c +++ b/src/lib/edc_editor.c @@ -230,6 +230,16 @@ syntax_color_apply(edit_data *ed, Eina_Bool partial) { Evas_Object *tb = elm_entry_textblock_get(ed->en_edit); char *text = (char *) evas_object_textblock_text_markup_get(tb); + int text_len = strlen(text); + + //FIXME: We encountered a syntax coloring issue that won't be applied + //at the opening an edc script. The situation condition is below, + //and we try syntax coloring again in that case. Work around logic, + //but it works. + if (text && (text_len == 0)) + { + return EINA_FALSE; + } int from_line = 1; int to_line = -1; @@ -238,13 +248,13 @@ syntax_color_apply(edit_data *ed, Eina_Bool partial) char *from = NULL; char *to = NULL; char *utf8 = (char *) color_cancel(NULL, syntax_color_data_get(ed->sh), text, - strlen(text), from_line, to_line, &from, + text_len, from_line, to_line, &from, &to); - if (!utf8) return EINA_FALSE; + if (!utf8) return EINA_TRUE; const char *translated = color_apply(NULL, syntax_color_data_get(ed->sh), utf8, strlen(utf8), from, to); - if (!translated) return EINA_FALSE; + if (!translated) return EINA_TRUE; /* I'm not sure this will be problem. But it can avoid entry_object_text_escaped_set() in Edje.