forked from enlightenment/enventor
Parse macro only if EDC is modified and group name is searched.
Previously, macro was parsed when EDC was changed. This caused performance issue. Now, macro is parsed only if EDC is changed and group name is searched.
This commit is contained in:
parent
335575eb84
commit
5120c20d84
|
@ -275,11 +275,7 @@ edit_changed_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
|
|||
Elm_Entry_Change_Info *info = event_info;
|
||||
edit_data *ed = data;
|
||||
edit_changed_set(ed, EINA_TRUE);
|
||||
|
||||
const char *text = elm_entry_entry_get(ed->en_edit);
|
||||
char *utf8 = elm_entry_markup_to_utf8(text);
|
||||
parser_macro_list_set(ed->pd, utf8);
|
||||
free(utf8);
|
||||
parser_changed_set(ed->pd, EINA_TRUE);
|
||||
|
||||
Eina_Bool syntax_color = EINA_TRUE;
|
||||
ed->error_line = -1;
|
||||
|
|
|
@ -58,6 +58,8 @@ struct parser_s
|
|||
cur_name_td *cntd;
|
||||
type_init_td *titd;
|
||||
Eina_List *macro_list;
|
||||
|
||||
Eina_Bool parser_changed : 1;
|
||||
};
|
||||
|
||||
|
||||
|
@ -302,7 +304,14 @@ group_name_thread_blocking(void *data, Ecore_Thread *thread EINA_UNUSED)
|
|||
int group_name_len = 0;
|
||||
|
||||
int cur_line = 1;
|
||||
Eina_List *macro_list = parser_macro_list_get(td->pd);
|
||||
Eina_List *macro_list = NULL;
|
||||
|
||||
if (parser_changed_get(td->pd))
|
||||
{
|
||||
parser_macro_list_set(td->pd, (const char *) utf8);
|
||||
parser_changed_set(td->pd, EINA_FALSE);
|
||||
}
|
||||
macro_list = parser_macro_list_get(td->pd);
|
||||
|
||||
while (p <= end)
|
||||
{
|
||||
|
@ -431,7 +440,14 @@ cur_state_thread_blocking(void *data, Ecore_Thread *thread EINA_UNUSED)
|
|||
double value_convert = 0.0;
|
||||
|
||||
int cur_line = 1;
|
||||
Eina_List *macro_list = parser_macro_list_get(td->pd);
|
||||
Eina_List *macro_list = NULL;
|
||||
|
||||
if (parser_changed_get(td->pd))
|
||||
{
|
||||
parser_macro_list_set(td->pd, (const char *) utf8);
|
||||
parser_changed_set(td->pd, EINA_FALSE);
|
||||
}
|
||||
macro_list = parser_macro_list_get(td->pd);
|
||||
|
||||
td->part_name = NULL;
|
||||
td->group_name = NULL;
|
||||
|
@ -2079,3 +2095,14 @@ parser_styles_pos_get(const Evas_Object *entry, int *ret)
|
|||
return parser_collections_block_pos_get(entry, "styles", ret);
|
||||
}
|
||||
|
||||
Eina_Bool
|
||||
parser_changed_get(parser_data *pd)
|
||||
{
|
||||
return pd->parser_changed;
|
||||
}
|
||||
|
||||
void
|
||||
parser_changed_set(parser_data *pd, Eina_Bool changed)
|
||||
{
|
||||
pd->parser_changed = changed;
|
||||
}
|
||||
|
|
|
@ -139,6 +139,8 @@ const char *parser_colon_pos_get(parser_data *pd EINA_UNUSED, const char *cur);
|
|||
Eina_Bool parser_state_info_get(Evas_Object *entry, state_info *info);
|
||||
void parser_macro_list_set(parser_data *pd, const char *text);
|
||||
Eina_List *parser_macro_list_get(parser_data *pd);
|
||||
Eina_Bool parser_changed_get(parser_data *pd);
|
||||
void parser_changed_set(parser_data *pd, Eina_Bool changed);
|
||||
|
||||
|
||||
/* syntax helper */
|
||||
|
|
Loading…
Reference in New Issue