Make special case for filetypes.matlab instead of truncating all

filetype config filenames at slash.



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5603 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Nick Treleaven 2011-03-17 17:03:01 +00:00
parent 55336b6cd8
commit c5b834629c
2 changed files with 6 additions and 5 deletions

View File

@ -20,6 +20,9 @@
* data/filetypes.Scala.conf, data/filetype_extensions.conf: * data/filetypes.Scala.conf, data/filetype_extensions.conf:
Add Scala custom filetype, based on file by werg (thanks). Add Scala custom filetype, based on file by werg (thanks).
(This uses the newly added [styling=C] syntax). (This uses the newly added [styling=C] syntax).
* src/filetypes.c:
Make special case for filetypes.matlab instead of truncating all
filetype config filenames at slash.
2011-03-15 Frank Lanitz <frank(at)frank(dot)uvena(dot)de> 2011-03-15 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>

View File

@ -1290,7 +1290,7 @@ void filetypes_load_config(gint ft_id, gboolean reload)
gchar *filetypes_get_conf_extension(gint filetype_idx) gchar *filetypes_get_conf_extension(gint filetype_idx)
{ {
gchar *result, *ptr; gchar *result;
GeanyFiletype *ft = filetypes[filetype_idx]; GeanyFiletype *ft = filetypes[filetype_idx];
if (ft->priv->custom) if (ft->priv->custom)
@ -1303,12 +1303,10 @@ gchar *filetypes_get_conf_extension(gint filetype_idx)
case GEANY_FILETYPES_CS: result = g_strdup("cs"); break; case GEANY_FILETYPES_CS: result = g_strdup("cs"); break;
case GEANY_FILETYPES_MAKE: result = g_strdup("makefile"); break; case GEANY_FILETYPES_MAKE: result = g_strdup("makefile"); break;
case GEANY_FILETYPES_NONE: result = g_strdup("common"); break; case GEANY_FILETYPES_NONE: result = g_strdup("common"); break;
/* name is Matlab/Octave */
case GEANY_FILETYPES_MATLAB: result = g_strdup("matlab"); break;
default: default:
result = g_ascii_strdown(ft->name, -1); result = g_ascii_strdown(ft->name, -1);
/* truncate at slash (e.g. for Matlab/Octave) */
ptr = strstr(result, "/");
if (ptr)
*ptr = 0x0;
break; break;
} }
return result; return result;