ajwillia-ms pushed a commit to branch master. http://git.enlightenment.org/tools/edi.git/commit/?id=155ec77ac8046427b88eb50a3d815a66181e727f
commit 155ec77ac8046427b88eb50a3d815a66181e727f Author: Andy Williams <a...@andywilliams.me> Date: Fri Aug 28 00:12:59 2015 +0100 [editor] fix stability of the highlighting thread Grab locks at the correct times, seems to help a lot... --- src/bin/editor/edi_editor.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/bin/editor/edi_editor.c b/src/bin/editor/edi_editor.c index 335b132..699c29f 100644 --- a/src/bin/editor/edi_editor.c +++ b/src/bin/editor/edi_editor.c @@ -256,11 +256,11 @@ _edi_range_color_set(Edi_Editor *editor, Edi_Range range, Elm_Code_Token_Type ty Elm_Code_Line *line, *extra_line; unsigned int number; + ecore_thread_main_loop_begin(); + code = elm_code_widget_code_get(editor->entry); line = elm_code_file_line_get(code->file, range.start.line); - ecore_thread_main_loop_begin(); - elm_code_line_token_add(line, range.start.col - 1, range.end.col - 2, range.end.line - range.start.line + 1, type); @@ -281,17 +281,19 @@ _edi_line_status_set(Edi_Editor *editor, unsigned int number, Elm_Code_Status_Ty Elm_Code *code; Elm_Code_Line *line; + ecore_thread_main_loop_begin(); + code = elm_code_widget_code_get(editor->entry); line = elm_code_file_line_get(code->file, number); if (!line) { if (text) ERR("Status on invalid line %d (\"%s\")", number, text); + + ecore_thread_main_loop_end(); return; } - ecore_thread_main_loop_begin(); - elm_code_line_status_set(line, status); if (text) elm_code_line_status_text_set(line, text); @@ -492,10 +494,14 @@ _edi_clang_setup(void *data, Ecore_Thread *thread EINA_UNUSED) char **clang_argv; unsigned int clang_argc; + ecore_thread_main_loop_begin(); + editor = (Edi_Editor *)data; code = elm_code_widget_code_get(editor->entry); path = elm_code_file_path_get(code->file); + ecore_thread_main_loop_end(); + /* Clang */ /* FIXME: index should probably be global. */ args = "-I/usr/inclue/ " EFL_CFLAGS " " CLANG_INCLUDES " -Wall -Wextra"; --