[Github-comments] [geany/geany-plugins] Project Organizer: Set header filetype to match source filetype (PR #1122)

Jiří Techet notifications at xxxxx
Wed Nov 10 14:46:33 UTC 2021


@techee commented on this pull request.



> +
+	if (prj_org)
+	{
+		header_patterns = get_precompiled_patterns(prj_org->header_patterns);
+	}
+	else
+	{
+		/* use default patterns when project isn't open */
+		gchar ** patterns = g_strsplit(PRJORG_PATTERNS_HEADER, " ", -1);
+		header_patterns = get_precompiled_patterns(patterns);
+		g_strfreev(patterns);
+	}
+
+	gchar * doc_basename = g_path_get_basename(doc->file_name);
+	gboolean is_header = patterns_match(header_patterns, doc_basename);
+	gchar * full_name = is_header ? find_header_source(doc) : NULL;

Just a style thing - could you move the declarations of the 3 variables to the beginning of the function and only assign the variables here?

Apart from this change the patch looks good to me.

-- 
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-plugins/pull/1122#pullrequestreview-802687833
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20211110/cbcf30da/attachment.htm>


More information about the Github-comments mailing list