OK, let's keep the priority then (for the single plugin that will use this API for a long time :-P)

I also noticed one tiny problem in

+#define CALL_PROVIDED(f, doc, ext)												\
+	G_STMT_START {																\
+		for (GList *node = all_extensions; node; node = node->next)				\
+		{																		\
+			PluginExtensionEntry *entry = node->data;							\
+																				\
+			if (entry->extension->f && entry->extension->f(doc, entry->data))	\
+				return (ext) ? entry->extension == (ext) : TRUE;				\
+		}																		\
+		return FALSE;															\
+	} G_STMT_END

I would also add

if ((ext) && entry->extension == (ext))
    return FALSE;

at the end of the loop because without it the loop will continue unnecessarily. This doesn't seem like a big problem but the call entry->extension->f(doc, entry->data) has the potential to start the LSP server process which would be started unnecessarily if some extension earlier in the chain were the target.

Again future-proofing our single-plugin use case ;-).

I'll try to prepare the patch tomorrow.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <geany/geany/pull/3849/c2153450917@github.com>