On Fri, 10 Sep 2010 12:38:57 +0100% Nick Treleaven nick.treleaven@btinternet.com wrote:
On Fri, 10 Sep 2010 11:11:02 +0400 Eugene Arshinov earshinov@gmail.com wrote:
IIUC, I think it would make the code much simpler if the user has to say which snippets they want keybindings for, not offering all snippets for keybindings.
Maybe, but what will the interface look like?
I thought it would just list the snippets asked for.
Anyway, I may be wrong about simplifying things, as I said, I haven't really studied the patch.
Sorry that you've put quite a lot of work into this, but I see snippet keybindings as an extra thing which most people might just type the snippet name, so I think the implementation has to be quite simple to justify maintaining the change.
Speaking about maintaining the change, maybe it's worth extracting snippet keybindings to a separate plugin? I think it can be done. In Geany itself I'll need a new signal on loading of snippets.conf, a function to activate a snippet by name, and a new function to set a keygroup with load and save callbacks.
The original patch may be simpler, maybe it's best not to have to read snippet keybindings from keybindings.conf...
Yes, it's simpler. But, on the opposite side, there a user must edit keybindings manually (probably with Preferences > Keybindings opened in order to determine the text representation of the needed keybinding) and she can't get "keybinding is already used" notifications. Though, most users will rarely (if ever) need snippet keybindings.
And, storing snippet keybindings in keybindings.conf, like all other keybindings, seems more natural to me, that saving them to snippets.conf. Though, AFAIK, Gedit Snippets plugin saves keybindings together with snippets.
Hard to justify :)
Best regards, Eugene.