[Geany-Devel] pull request on GitHub, to add GeanyHighlightSelectedWords, into Geany Plugins

Matthew Brush mbrush at xxxxx
Thu Jul 9 02:41:55 UTC 2015


On 2015-07-08 07:28 PM, Steve wrote:
>
> On Jul 8, 2015 7:18 PM, Matthew Brush <mbrush at codebrainz.ca> wrote:
>>
>> On 2015-07-08 10:57 AM, Steven Blatnick wrote:
>>> So I've finally got a chance to look at my non-API calls.  I was able to
>>> code around most of them, but there are two that would be much easier if
>>> we could make them APIs.  (I haven't pushed any of these changes to my
>>> git repo yet.)  Could we consider making these API?
>>>
>>>     * keybindings_load_keyfile - I dynamically add/remove a variable
>>>       number of plugin keybindings based on the plugin settings, so this
>>>       allows me to refresh the results easily.  This allows my
>>>       external-tools plugin to have any number of tools with each their
>>>       own keybinding.  Otherwise, most plugins have a set number of bindings.
>>
>> This sounds dubious.
>>
>> I assume you're talking about `external-tools` plugin? Maybe I don't
>> understand the code enough, but it looks to me like it's just leaking
>> GeanyKeyGroups in `reload_tools()` and then calling
>> `keybindings_load_keyfile()` happens to reload the key group it newly
>> created?
>>
>> I completely agree there needs to be a way to dynamically add/remove
>> keybindings, but I'm not sure we should promote this way if I understand
>> it correctly. IMO, it would be much better to fix Geany.
> I agree.  Maybe a reload_plugin type function?  I saw a similar problem in gedit plugins, where you have to restart the editor for some things to take effect.  And you're right, if i remember correctly, I just want to be able to reload my own shortcuts, and the existing call does them all, which is overkill to say the least.
>>

GeanyPy, which also has sub-"tools" (still called plugins, but in Python 
scripts) has the same problem. I'll bet GeanyLua and GeanyMiniScript 
suffer of the same.

>>>     * keybindings_lookup_item - I know keybindings_get_item is available
>>>       already, but I am attempting to look up a core group keybinding and
>>>       not plugin's own keybindings.
>>
>> This sounds reasonable, though I think it would be better if made public
>> to rename it to something like `keybindings_get_builtin_item()` or
>> something. Also I think we should change the signature to use the
>> correct types (those enums we already expose).
> Alternatively, is there an event i can tie in to?  Basically the issue here is in focusing on the side panel or bottom panel, the focus lands in the wrong place to then capture ctrl+pg_up/down to switch notebook tabs.  For example, when focusing my panel in external-tools, I need the focus to update to the read-only text field instead of the notebook tab label.  I know I can use tab, but I'm trying to make the usage fluid.
>

You could probably dig-out the appropriate widgets from the 
Glade/GtkBuilder UI and connect to GtkWidget events such as "focus-in" 
and such, but I have the feeling the way you're doing it is better, 
without having actually looked at this part of the code.

>>
>>>     * keybindings_dialog_show_prefs_scroll - I remember someone saying the
>>>       "Configure Plugins" window would have a button to this already in a
>>>       later version, but I still don't see it.  I only need this API if
>>>       the button isn't added.
>>>
>>
>> Could probably make such a button/link use the same code as the
>> "Keybindings" button in the Plugin Manager dialog, since it does just
>> that. It might be a bit awkward UI-wise though.
> I'm not sure why that would be awkward?  I'm away from the code right now, but I think this call is the same as that button, it just needs to be made an API.
>>

I probably would have to see it. I just mean I can't envision a way to 
add a "Keybindings" to that "Configure Plugin" dialog that would be 
global to all plugin tabs.

Cheers,
Matthew Brush


More information about the Devel mailing list