ajwillia-ms pushed a commit to branch master. http://git.enlightenment.org/tools/edi.git/commit/?id=7bb4a7cc24c5d7d06188089dfa42fa8609ee6939
commit 7bb4a7cc24c5d7d06188089dfa42fa8609ee6939 Author: Andy Williams <a...@andywilliams.me> Date: Thu Sep 7 21:00:31 2017 +0100 syntax: Fix python syntax by adding a basic provider --- src/bin/language/edi_language_provider.c | 8 +++++ src/bin/language/edi_language_provider_python.c | 42 +++++++++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/src/bin/language/edi_language_provider.c b/src/bin/language/edi_language_provider.c index bd5ca7f..b16585a 100644 --- a/src/bin/language/edi_language_provider.c +++ b/src/bin/language/edi_language_provider.c @@ -9,6 +9,7 @@ #include "edi_private.h" #include "edi_language_provider_c.c" +#include "edi_language_provider_python.c" #include "edi_language_provider_rust.c" static Edi_Language_Provider _edi_language_provider_registry[] = @@ -19,6 +20,11 @@ static Edi_Language_Provider _edi_language_provider_registry[] = _edi_language_c_lookup, _edi_language_c_lookup_doc }, { + "python", _edi_language_python_add, _edi_language_python_refresh, _edi_language_python_del, + _edi_language_python_mime_name, _edi_language_python_snippet_get, + NULL, NULL + }, + { "rust", _edi_language_rust_add, _edi_language_rust_refresh, _edi_language_rust_del, _edi_language_rust_mime_name, _edi_language_rust_snippet_get, NULL, NULL @@ -47,6 +53,8 @@ Edi_Language_Provider *edi_language_provider_for_mime_get(const char *mime) id = "c"; if (!strcasecmp(mime, "text/rust")) id = "rust"; + if (!strcasecmp(mime, "text/x-python")) + id = "python"; if (!id) return NULL; diff --git a/src/bin/language/edi_language_provider_python.c b/src/bin/language/edi_language_provider_python.c new file mode 100644 index 0000000..551780f --- /dev/null +++ b/src/bin/language/edi_language_provider_python.c @@ -0,0 +1,42 @@ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include <Eina.h> + +#include "edi_language_provider.h" + +#include "edi_config.h" + +#include "edi_private.h" + +void +_edi_language_python_add(Edi_Editor *editor EINA_UNUSED) +{ +} + +void +_edi_language_python_refresh(Edi_Editor *editor EINA_UNUSED) +{ +} + +void +_edi_language_python_del(Edi_Editor *editor EINA_UNUSED) +{ +} + +const char * +_edi_language_python_mime_name(const char *mime) +{ + if (!strcasecmp(mime, "text/x-python")) + return "Python source"; + + return NULL; +} + +const char * +_edi_language_python_snippet_get(const char *key EINA_UNUSED) +{ + return NULL; +} + --