Hi all.
I'd say I qualify with a frequent and happy Geany user, as I just love that IDE — been my favourite for nearly two decades now.
The issue I have is somewhat annoying and describes as follows: * Enable the VTE in Geany preferences * In Geany additions preferences, enable " _Enclose selection automatically without requiring a shortcut_ " * Select some text in the editor * Switch to the VTE and type a command that requires quoting, parentheses or braces
**What happens**: the previously selected text is enclosed with the first enclosing character that occurred while typing in the VTE instead of being silently eaten, as one would expect.
I use the VTE on a regular basis and I found myself accepting to watch out for any selection before I use the VTE. But despite my efforts I fail and I think that's to be expected, as a human :-D .
*DISCLAIMER: I don't know if it's a VTE issue, a plugin issue, a geany issue or a GTK issue; I needed to start somewhere so I submit it here.* Be free to dispatch it at will to the right audience if that's necessary. And if *I* need to do that, I will, no wuckers. Just orient me.
As for the techno stuff, before you ask: I'm running Geany on Manjaro. My current version is **1.38-2** "_Sulamar_" and plugins are version **1.38-3**. The issue I described has existed for as long as I can remember.
I'd like to thank the community for providing such a great, bloat-free tool, a breathe compared to the usual monsters, IMHO. May the Geany remain out the bottle for a long, long time.
ℼ
It is nothing to do with terminal. The same thing happens if a valid "enclosing" character is typed anywhere, eg scribble tab or toolbar entries.
It would appear that the plugin does not check if the focus is in the edit pane before acting, instead it intercepts characters typed in any part of the Geany window and acts on them.
Thanks for clarifying, sounds quite logical indeed :+1:
Is there anything to do on my part? I might as well submit a patch — I'd happily do. However since (I guess) it's most probably a one liner such as `if (!editor_pane->has_focus()) { /* blah */ } ` I might need to spend way more time looking for where to add that line than typing the actual code. Not that it bothers me but I prefer having a few hints beforehand.
BTW (out of curiosity) is it okay to submit such a patch here or would you rather expect a pull requests?
ℼ
Note that the diagnosis is without reading the code, it may be wrong (he says for CYA purposes :-).
Add-ons plugin contains a number of contributed bits that are too small to justify the overhead of a standalone plugin, thats why its called "add ons". Not all the contributors continue to check if their contribution has bug reports, so if you wait for a bit and nobody acknowledges they are looking into it, then probably best if you do it yourself.
Pull requests are preferred since thats the project workflow, a patch would need to be made into a PR which is more effort and would make it less likely to get merged in a project limited by volunteer time available.
Pull requests are preferred since thats the project workflow, a patch would need to be made into a PR which is more effort and would make it less likely to get merged in a project limited by volunteer time available.
I understand. On the other hand I'd prefer sending a patch as I'm not yet familiar (at all, that is) with pull requests — it also sounds like a lot of work pulling the complete repo (twice, if I got it right, one public and one on my machine) for (what I assume) one added line of code, especially for a one-shot exercise. And I have no public repository in fact. I don't even plan to. So I'll see what I can do and post again here whatever happens :) .
I have investigated the issue a little further and I'm no longer sure it's that straightforward. I found the spot where to add the focus condition; it's in `/addons/src/ao_wrapwords.c`, about line 66.
However, trying to find how to get whether a scintilla object has the focus, I read on StackOverflow that an event function only requires "binding to the object if one wants that even to fire only when the widget has the focus" (see https://stackoverflow.com/a/1385933).
If that's true and if it's the proper way to avoid addon widgets messing with other widgets when they don't have the focus, then I'm afraid it's not at all within the extent of my skills as I have absolutely zero knowledge (let alone experience) with Scintilla... which I only got to know about while browsing the files on this repo, to get you an idea. And I don't want to put the whole Geany Addons project in balance if there happens to be an implementation issue buried deep inside, which I'm completely incompetent to judge and fix if it needs to.
No, its not line 66.
Its likely in `on_key_press()` where it tests for the "enclose" characters, that should be called by the Scintilla `char added` [notification](https://www.geany.org/manual/reference/pluginsignals_8c.html#a2982093b5402f0...) instead of the application wide [keypress](https://github.com/geany/geany-plugins/blob/7900eb3b0f0b015e0999ad52a4ea8344...), and then it knows its a keypress from Scintilla.
Thanks. Will see what I can do. I'll try and post here what I'll come up with. Thanks a lot for your hints.
Sorry for being late at the party.
I'll close this issue. I've stopped my investigations a while ago, turns out way too complicated for me to understand it all. I've scraped the code and end up with no idea where the problem lies, even less how to fix it. I'll live with it and rant anytime it happens but I'm unable to help myself here :( .
Closed #1181 as completed.
github-comments@lists.geany.org