hermet pushed a commit to branch master.

http://git.enlightenment.org/tools/enventor.git/commit/?id=4353d98bac185a92b377972eefa478990c7167d9

commit 4353d98bac185a92b377972eefa478990c7167d9
Author: Hermet Park <[email protected]>
Date:   Mon Jul 4 13:07:24 2016 +0900

    multi-file: make multi files work for auto completion.
---
 src/lib/auto_comp.c        | 8 ++++++++
 src/lib/edc_editor.c       | 6 ++++++
 src/lib/enventor_private.h | 1 +
 src/lib/enventor_smart.c   | 4 ++--
 4 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/src/lib/auto_comp.c b/src/lib/auto_comp.c
index 0ff3131..a9d9be5 100644
--- a/src/lib/auto_comp.c
+++ b/src/lib/auto_comp.c
@@ -153,6 +153,14 @@ context_lexem_thread_cb(void *data, Ecore_Thread *thread 
EINA_UNUSED)
    Eina_Bool find_flag = EINA_FALSE;
    Eina_Bool dot_lex = EINA_FALSE;
 
+   //In case of sub items, it won't contain "collections".
+   //We added it arbitrary.
+   if (!edit_is_main_file(td->ad->ed))
+     {
+        strcpy(stack[depth], "collections");
+        depth++;
+     }
+
    while (cur && cur <= end)
      {
         //Check inside quote
diff --git a/src/lib/edc_editor.c b/src/lib/edc_editor.c
index fe5d217..874315c 100644
--- a/src/lib/edc_editor.c
+++ b/src/lib/edc_editor.c
@@ -1829,3 +1829,9 @@ edit_text_get(edit_data *ed)
 {
    return elm_entry_entry_get(ed->en_edit);
 }
+
+Eina_Bool
+edit_is_main_file(edit_data *ed)
+{
+   return ed->main;
+}
diff --git a/src/lib/enventor_private.h b/src/lib/enventor_private.h
index 6c94529..4d7a3f5 100644
--- a/src/lib/enventor_private.h
+++ b/src/lib/enventor_private.h
@@ -282,6 +282,7 @@ void edit_select_none(edit_data *ed);
 void edit_cursor_pos_set(edit_data *ed, int position);
 int edit_cursor_pos_get(edit_data *ed);
 const char *edit_selection_get(edit_data *ed);
+Eina_Bool edit_is_main_file(edit_data *ed);
 
 /* util */
 void mem_fail_msg(void);
diff --git a/src/lib/enventor_smart.c b/src/lib/enventor_smart.c
index 93d7ee0..5b46760 100644
--- a/src/lib/enventor_smart.c
+++ b/src/lib/enventor_smart.c
@@ -356,7 +356,6 @@ _enventor_object_efl_file_file_set(Eo *obj EINA_UNUSED,
                                    const char *group EINA_UNUSED)
 {
    build_edc_path_set(file);
-   autocomp_target_set(pd->main_it.ed);
    if (!file) goto err;
 
    /* Create empty file*/
@@ -869,7 +868,6 @@ enventor_object_sub_item_add(Enventor_Object *obj, const 
char *file)
    it->ed = edit_init(obj, EINA_FALSE);
    it->pd = pd;
 
-   autocomp_target_set(it->ed);
    edit_load(it->ed, file);
    edit_changed_set(it->ed, EINA_FALSE);
 
@@ -938,6 +936,8 @@ enventor_item_focus_set(Enventor_Item *it)
    edit_font_scale_set(it->ed, pd->font_scale);
    edit_disabled_set(it->ed, pd->disabled);
 
+   autocomp_target_set(it->ed);
+
    return EINA_TRUE;
 }
 

-- 


Reply via email to