jaehyun pushed a commit to branch master.

http://git.enlightenment.org/tools/enventor.git/commit/?id=773b93e792375dead3be49abe80c778ef667b68e

commit 773b93e792375dead3be49abe80c778ef667b68e
Author: Jaehyun Cho <jae_hyun....@samsung.com>
Date:   Tue Jul 19 21:22:15 2016 +0900

    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.
---
 src/lib/enventor_smart.c |  2 +-
 src/lib/reference.c      | 14 +++++++++++++-
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/src/lib/enventor_smart.c b/src/lib/enventor_smart.c
index a7b563f..de9e331 100644
--- a/src/lib/enventor_smart.c
+++ b/src/lib/enventor_smart.c
@@ -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);
 }
 
 /*****************************************************************************/
diff --git a/src/lib/reference.c b/src/lib/reference.c
index b16d343..a7da91e 100644
--- a/src/lib/reference.c
+++ b/src/lib/reference.c
@@ -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;
 }
 

-- 


Reply via email to