[Github-comments] [geany/geany] highlighting: added API call to query GeanyLexerStyle by name (#2336)

elextr notifications at xxxxx
Thu Oct 3 20:30:19 UTC 2019


elextr requested changes on this pull request.

The use-case makes sense now that its explained clearly.

> + * @return A pointer to the style struct.
+ */
+GEANY_API_SYMBOL
+const GeanyLexerStyle *highlighting_get_named_style(const gchar *named_style)
+{
+	GeanyLexerStyle *cs;
+	gchar *comma, *name = NULL;
+
+	g_return_val_if_fail(named_style, NULL);
+	name = utils_strdupa(named_style);	/* named_style must not be written to, may be a static string */
+
+	comma = strstr(name, ",");
+	if (comma)
+	{
+		*comma = '\0';	/* terminate name to make lookup work */
+	}

Whats this doing? If you pass a name why does it need to terminate at a comma?  Either this is functionality specific to the particular useage, in which case it should be in the caller, or it should be documented behaviour with an explanation of why.

-- 
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/2336#pullrequestreview-297130510
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20191003/cfe41044/attachment.html>


More information about the Github-comments mailing list