Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
plugins: introduce probe() for proxy plugins
When a file extension alone is ambigious as to whether a potential plugin is really handled then the proxy should use the probe hook to find out. This can be especially helpful when two pluxies work on the same file extension. The proxy's probe() should return PROXY_IGNORED or PROXY_MATCHED accordingly. A special flag value, PROXY_NOLOAD, can be or'ed into PROXY_MATCHED to say that the file belongs to the proxy, but isn't directly loaded and should not be handled by any other proxy or geany itself. Example for PROXY_IGNORED: geanypy only supports python2 at the moment. So, scripts written for python3 aren't handled by it and should be skipped for the PM dialog. Or perhaps they are handled by another proxy that supports python3. Example for PROXY_NOLOAD: A pluxy registers for the metadata file extension (.plugin) where author etc is in. The actual implmentation is in a python script (.py). The .py file is tied to the .plugin and should not be processed by other pluxies. Thus, the pluxy also registers for the .py extension but returns PROXY_MATCHED|PROXY_NOLOAD for it (if it would return only PROXY_MATCHED the sub-plugin would show up twice in the PM dialog).
- Loading branch information