In src/highlighting.c:

> @@ -1776,3 +1776,23 @@ gboolean highlighting_is_code_style(gint lexer, gint style)
>  	return !(highlighting_is_comment_style(lexer, style) ||
>  		highlighting_is_string_style(lexer, style));
>  }
> +
> +
> +gchar **highlighting_get_keywords(GeanyFiletypeID filetype_id)
> +{
> +	GString *str = g_string_sized_new(1000);
> +	gchar **keywords;
> +	gchar **keyword_str;
> +
> +	foreach_strv(keyword_str, style_sets[filetype_id].keywords)
> +	{
> +		g_string_append(str, *keyword_str);
> +		g_string_append_c(str, ' ');
> +	}
> +
> +	keywords = g_strsplit(str->str, " ", -1);

This is definitively a good candidate for a source code comment explaining what was explained in the comments here. My eyes almost popped out of my head when I saw this code (in the accidentally pushed branch) that @techee of all people would write something so ridiculously indirect and inefficient :)

Maybe something like:

Scintilla requires keywords as a space-separated string so that's how we store them. Concat all of those strings together and then split them once at the end.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.