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

xiota notifications at xxxxx
Thu Oct 28 21:44:48 UTC 2021


@xiota commented on this pull request.



> @@ -167,6 +307,7 @@ PluginCallback plugin_callbacks[] = {
 	{"document-open", (GCallback) & on_doc_open, TRUE, NULL},
 	{"document-activate", (GCallback) & on_doc_activate, TRUE, NULL},
 	{"document-close", (GCallback) & on_doc_close, TRUE, NULL},
+	{"document-filetype-set", (GCallback) & on_doc_filetype_set, TRUE, NULL},

I chose to use that signal because it is more specific for what is intended.

I did not try the open signal, but suppose the Geany opens the file and sends the open signal.  Then the plugin changes the file type.  Then Geany changes the filetype and sends the filetype signal.  Then the plugin won't have accomplished what was intended.

While I agree that generally the plugin should not override a user selection, the plugin would be changing file types of only header files.  It's unlikely that the user would need/want to change the type of headers to something not matching the source file.

If you prefer, I will use the document-open signal when I reorganize the code according to what you suggested in another comment.

-- 
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#discussion_r738796522
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20211028/a8ab96c2/attachment-0001.htm>


More information about the Github-comments mailing list