edi: hook in shell highlighting.

Added initial shell highlighting to the widget. Add here to tweak
as needed. What a keyword is, is debatable.
master
Alastair Poole 11 months ago
parent 06bf332331
commit 554b22c929
  1. 8
      src/bin/language/edi_language_provider.c
  2. 3
      src/lib/edi_mime.c

@ -13,6 +13,7 @@
#include "edi_language_provider_rust.c"
#include "edi_language_provider_go.c"
#include "edi_language_provider_csharp.c"
#include "edi_language_provider_shell.c"
static Edi_Language_Provider _edi_language_provider_registry[] =
{
@ -41,6 +42,11 @@ static Edi_Language_Provider _edi_language_provider_registry[] =
_edi_language_csharp_mime_name, _edi_language_csharp_snippet_get,
NULL, NULL
},
{
"shell", _edi_language_shell_add, _edi_language_shell_refresh, _edi_language_shell_del,
_edi_language_shell_mime_name, _edi_language_shell_snippet_get,
NULL, NULL
},
{NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
@ -71,6 +77,8 @@ Edi_Language_Provider *edi_language_provider_for_mime_get(const char *mime)
id = "go";
if (!strcasecmp(mime, "text/x-csharp"))
id = "csharp";
if (!strcasecmp(mime, "application/x-shellscript"))
id = "shell";
if (!id)
return NULL;

@ -54,7 +54,8 @@ edi_mime_type_get(const char *path)
eina_file_close(f);
mime = efreet_mime_type_get(path);
if (mime && (strncmp(mime, "text/", 5)) && likely_text)
if (!strcmp(mime, "application/x-shellscript")) return mime;
if ((mime) && (strncmp(mime, "text/", 5)) && (likely_text))
{
return "text/plain";
}

Loading…
Cancel
Save