Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZenEditor_get_syntax fix #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/zen-editor.c
Expand Up @@ -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);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type is leaked here, it should be passed to g_free() before returning.

}


Expand Down