reference: Support keyword reference in multi-file structure.

Show keyword reference of the focused item entry.
Append "collections" to parent keyword list arbitrary if the focused
item is not the main item.
This commit is contained in:
Jaehyun Cho 2016-07-19 21:22:15 +09:00
parent 44e36e8b69
commit 773b93e792
2 changed files with 14 additions and 2 deletions

View File

@ -780,7 +780,7 @@ EOLIAN static void
_enventor_object_keyword_reference_show(Eo *obj EINA_UNUSED,
Enventor_Object_Data *pd)
{
ref_show(pd->main_it->ed);
ref_show(pd->focused_it->ed);
}
/*****************************************************************************/

View File

@ -187,11 +187,15 @@ str_list_same_check(Eina_List *str_list1, Eina_List *str_list2)
static Eina_List *
keyword_parent_name_list_find(const char *text, const char *keyword_name)
{
Eina_List *parent_name_list = NULL;
ref_data *md = g_md;
if (!md) return NULL;
if (!md->ed) return NULL;
if (!text) return NULL;
if (!keyword_name) return NULL;
Eina_List *parent_name_list = NULL;
//Check from the end of the text.
char *ptr = (char *)(text + ((strlen(text) - 1) * sizeof(char)));
int height = 0;
@ -262,6 +266,14 @@ keyword_parent_name_list_find(const char *text, const char *keyword_name)
ptr--;
}
//In case of sub items, it won't contain "collections".
//We added it arbitrary.
if (!edit_is_main_file(md->ed))
{
parent_name_list = eina_list_append(parent_name_list,
strdup("collections"));
}
return parent_name_list;
}