Commit 93c6cf81 authored by Christian Hergert's avatar Christian Hergert
Browse files

language: fix license expansion for templates

We need an extra escape for lines ending in }} because template-glib
will swallow them.

Fixes #323
parent afbbbb14
......@@ -70,9 +70,7 @@ ide_language_format_header (GtkSourceLanguage *self,
}
else if (line_prefix == NULL)
{
guint i;
for (i = 0; i < prefix_len; i++)
for (guint i = 0; i < prefix_len; i++)
g_string_append_c (outstr, ' ');
}
else
......@@ -86,6 +84,12 @@ ide_language_format_header (GtkSourceLanguage *self,
g_string_append_len (outstr, line, len);
}
/* Lines ending in expansion need an extra \n */
if (outstr->len > 2 &&
outstr->str[outstr->len - 2] == '}' &&
outstr->str[outstr->len - 1] == '}')
g_string_append_c (outstr, '\n');
g_string_append_c (outstr, '\n');
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment