On Mon, 17 Mar 2008 10:24:34 -0500 "Jeff Pohlmeyer" yetanothergeek@gmail.com wrote:
On Wed, Mar 12, 2008 at 12:30 PM, Nick Treleaven nick.treleaven@btinternet.com wrote:
Hi all plugin authors, For the details on how to add keybindings to your plugins please see plugins/htmlchars.c, and post here if you need more information.
Another thing I would like some clarification about - Toggling a plugin off/on in the plugin manager causes it to forget any saved keybinding settings. Which seems logical for a lot of cases, if you don't want the plugin enabled, then you probably don't want its settings cluttering up the config file. For plugins with only a couple of keybindings, this is not really a problem for the user to go back and reconfigure the settings.
I've been meaning to add support for loading an individual plugin's keybindings when enabled in the plugin manager. I don't think it matters about keeping unloaded plugin's shortcuts in the keyfile really. I wasn't not sure whether it's necessary to save configured shortcuts when the user decides to unload a plugin (although there should at least be a warning somewhere).
But since people are already talking about 12+ keys for the Lua plugin, I hated to see this information lost without warning at the click of a checkbox, so I added some code to let the Lua plugin save it own keybindings to its own config file when it is unloaded. IMO, this is the best approach, if a plugin wants its keys saved when it is unloaded, then it is the responsibility of the plugin to save them.
Hmm, I don't really see it as the plugin's responsibility, perhaps it should be in the core. I don't like the idea of having some keybindings in Geany's keyfile and some in a plugin's keyfile, it doesn't seem a tidy solution.
Regards, Nick