I am new to Geany plugins and GTK development in general, and I'd like
to know some best practices (and how-to's) for a plugin I'm working
on. It does code folding, by level--that is, rather than folding all
of the code at once, just the top-level or second-level (or
third-level...). (This is very useful to me, as I can open a file and
get all the functions at a glance, or e.g. for a python class look at
all the function defs by folding the second level, and so on.) I did
so by essentially copying the folding code in Geany's fold_all
function, and then adding a submenu and keybindings to call the
function.
I think this may be useful to others and I'd like to submit it to
geany-plugins, but I have a couple questions first:
1) The submenu is in the tools menu, but I feel it would be better in
the Document menu underneath the existing folding functions. Is this a
good idea, and if so, how to I get at the document menu (since I can't
say geany->main_widgets->tools_menu)?
2) I didn't set the keybindings since it's not recommended as it may
interfere with existing ones. Is there a way to set them if the given
key is not in use, or is that a bad idea?
3) In the actual folding code I used sci_get_fold_level (and a couple
other scintilla wrappers) which aren't in the plugin API so I gather
my plugin may break at some point. There doesn't seem to be a way
around this for what I want to do. Is this ok?
4) Is there another plugin out there that does this? I couldn't find one.
5) Would geany-plugins accept another plugin?
Thanks,
Peter O'Malley