From 6bf31d96aa92e5335720b86947405c7eb69dfacb Mon Sep 17 00:00:00 2001 From: oco Date: Wed, 3 Aug 2016 17:02:54 +0300 Subject: [PATCH] ZenEditor_get_syntax fix --- src/zen-editor.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/zen-editor.c b/src/zen-editor.c index 24b2ce3..b2f9021 100644 --- a/src/zen-editor.c +++ b/src/zen-editor.c @@ -636,8 +636,17 @@ ZenEditor_init_profiles(ZenEditor *self, PyObject *args) static PyObject * ZenEditor_get_syntax(ZenEditor *self, PyObject *args) { + GeanyDocument *doc; + print_called(); - return PyString_FromString("html"); + + doc = ZenEditor_get_context(self); + if (doc == NULL) + return NULL; + + gchar *type = g_ascii_strdown(doc->file_type->name, -1); + + return PyString_FromString(type); }