ajwillia-ms pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=c19d3b402a163910bb4b69fc5e3da1a517247529

commit c19d3b402a163910bb4b69fc5e3da1a517247529
Author: Andy Williams <[email protected]>
Date:   Sat Mar 4 15:39:24 2017 +0000

    elm_code: Fix missing syntax for .eo files
    
    This was accidentally removed in the transition from edi.
    using text/x-eolian which is not well reported by the FS yet.
    @fix
---
 src/lib/elementary/elm_code_syntax.c | 25 +++++++++++++++++++++++++
 src/lib/elementary/elm_code_widget.c |  3 +++
 2 files changed, 28 insertions(+)

diff --git a/src/lib/elementary/elm_code_syntax.c 
b/src/lib/elementary/elm_code_syntax.c
index 80adead..5fbb415 100644
--- a/src/lib/elementary/elm_code_syntax.c
+++ b/src/lib/elementary/elm_code_syntax.c
@@ -42,13 +42,38 @@ static Elm_Code_Syntax _elm_code_syntax_py =
     "or", "pass", "raise", "return", "try", "while", "with", "yield"}
 };
 
+static Elm_Code_Syntax _elm_code_syntax_eo =
+{
+   "{}():;*,.",
+   NULL,
+   "//",
+   "[[",
+   "]]",
+   {"byte", "ubyte", "char", "short", "ushort", "int", "uint", "long", 
"ulong", \
+    "llong", "ullong", "int8", "uint8", "int16", "uint16", "int32", "uint32", \
+    "int64", "uint64", "int128", "uint128", "size", "ssize", "intptr", 
"uintptr", \
+    "ptrdiff", "time", "float", "double", "bool", "void", "void_ptr", \
+    "string", "stringshare", "generic_value", \
+    "abstract", "class", "data", "mixin", "import", "interface", "type", 
"const", "var", \
+    "own", "free", "struct", "enum", "@extern", "@free", "@auto", "@empty", \
+    "@private", "@protected", "@beta", "@hot", "@const", "@class", 
"@virtual_pure", \
+    "@property", "@nonull", "@nullable", "@optional", "@in", "@out", "@inout", 
"@warn_unused", \
+    "eo_prefix", "legacy_prefix", "methods", "events", "params", "return", 
"legacy", \
+    "implements", "constructors", "get", "set", "keys", "values", "true", 
"false", "null"}
+};
+
+
 EAPI Elm_Code_Syntax *
 elm_code_syntax_for_mime_get(const char *mime)
 {
+   if (!mime) return NULL;
+
    if (!strcmp("text/x-chdr", mime) || !strcmp("text/x-csrc", mime))
      return &_elm_code_syntax_c;
    if (!strcmp("text/x-python", mime))
      return &_elm_code_syntax_py;
+   if (!strcmp("text/x-eolian", mime))
+     return &_elm_code_syntax_eo;
 
    return NULL;
 }
diff --git a/src/lib/elementary/elm_code_widget.c 
b/src/lib/elementary/elm_code_widget.c
index 62ff893..4d0ea3a 100644
--- a/src/lib/elementary/elm_code_widget.c
+++ b/src/lib/elementary/elm_code_widget.c
@@ -2132,6 +2132,9 @@ _elm_code_widget_syntax_enabled_set(Eo *obj, 
Elm_Code_Widget_Data *pd EINA_UNUSE
      elm_code_parser_standard_add(code, ELM_CODE_PARSER_STANDARD_SYNTAX);
    else
      code->parsers = eina_list_remove(code->parsers, 
ELM_CODE_PARSER_STANDARD_SYNTAX);
+
+   _elm_code_parse_reset_file(code, code->file);
+   _elm_code_widget_fill(obj);
 }
 
 EOLIAN static Eina_Bool

-- 


Reply via email to