[Github-comments] [geany/geany] Add keywords to the autocompletion list (#1146)

Jiří Techet notifications at xxxxx
Fri Jul 22 19:08:22 UTC 2016


> @@ -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);

Nope: the thing is style_sets[filetype_id].keywords contains (for C) at index 0 a space-separated string of primary keywords, at index 1 a space separated string of secondary keywords, at index 2 a space separated string of docstrings. I concatenate those so there's one big space-separated string containing everything and split it by space.

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/1146/files/1e74c11aca41274d690d8da0b6e59b1247fbb222#r71930067
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20160722/4dbc124f/attachment.html>


More information about the Github-comments mailing list