hermet pushed a commit to branch master. http://git.enlightenment.org/tools/enventor.git/commit/?id=08a2d9d03855afe0b5959b08570d7e53b7c2ff3b
commit 08a2d9d03855afe0b5959b08570d7e53b7c2ff3b Author: Mykyta Biliavskyi <m.biliavs...@samsung.com> Date: Thu Aug 20 11:07:36 2015 +0900 Edc_editor: run programs in case if name placed on new line. Summary: launch programs in cases when program name is placed not in the same paragraph with "program" keyword. Now analyzes whole text, that placed after selected keyword, not only text inside the same paragraph. @fix Reviewers: Hermet Differential Revision: https://phab.enlightenment.org/D2964 --- src/lib/edc_editor.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/lib/edc_editor.c b/src/lib/edc_editor.c index e2db0e6..4b7e6d4 100644 --- a/src/lib/edc_editor.c +++ b/src/lib/edc_editor.c @@ -589,11 +589,16 @@ edit_cursor_double_clicked_cb(void *data, Evas_Object *obj, Evas_Object *textblock = elm_entry_textblock_get(obj); Evas_Textblock_Cursor *cursor = evas_object_textblock_cursor_get(textblock); - const char *str = evas_textblock_cursor_paragraph_text_get(cursor); + const char *str = elm_entry_entry_get(obj); char *text = elm_entry_markup_to_utf8(str); - char *cur = strstr(text, selected); - - if (!strcmp(selected, "program")) + int cur_pos = elm_entry_cursor_pos_get(obj); + char *cur = text + (cur_pos - strlen(selected)); + + /* TODO: improve parser_name_get, for recognize cases when name is absent. + * Because right now any text inside quotes that placed after selection is + * recognized as name. + */ + if (!strcmp(selected, "program")) { program_run(ed, cur); } --