[Github-comments] [geany-plugins] autoclose support for block comments (#281)

Colomban Wendling notifications at xxxxx
Wed Mar 16 19:32:59 UTC 2016


> @Akronix, autoclose relies on internal Geany's feature of pairs matching (like possibility to highlight pairing brace). So implementing this may require to patch Geany core.

Matching the end of the comment could be a fun feature, but probably not as a match brace one, as it's clearly not a brace (in most languages).

However, Geany understands multi-line comments in its filetype settings, and it could be reasonably easy for a plugin to combine that (`GeanyFileType::comment_open` and `GeanyFileType::comment_close`, which are not yet part of the API but I guess a reasonable and easy addition) and possibly the current style classification ([`highlighting_is_comment_style()`](https://www.geany.org/manual/reference/highlighting_8h.html#af2de7822f2fcd8bfad90041c39b0a1d1)).

> Even more. There are three different implementations of autoclosing feature (core, addons plugin and autoclose plugin).

A good question could really be "why on earth is there *three* implementations?".  Most obvious answers that come to my mind are

* people don't agree on what the feature should be, so there are different, incompatible implementations
* people didn't care to patch Geany (there are no open PR or issue on that matter currently, so no, it's not only that we haven't responded), and created their own plugin instead, not noticing another one existed already
* NIH: if you implement your thing, you know how it works, you don't have to bother understanding somebody else's choices/POV/whatever.

This is not a critique, I would perfectly understand every of those points.  If you just want the thing working the way you like, it's often easier to just write it than try and change something already existing if the feature isn't too complex it would take a lot of time to implement in the first place.  Yes, if someone came in with a patch, it would probably get discussed, questions asked and answers expected (and yes, sometimes nobody will even step up¹), which takes time on both parts, and a will to both defend one's choices and accept reviews and opinions of others.  It's possibly harder.

This said, for this particular feature I don't know if I'd love a PR :)  I don't like this feature, and never saw any sane implementation that never got in my way (fairly enough, I didn't search for it, just saw some annoying ones) -- and I live fine without it.
I can perfectly understand someone wanting this, and a plugin seems like a perfect fit for this to me, especially as it doesn't seem so easy to get "right" (autclose seem to be about 1000 lines of C code), in which case a dedicated thing seems to make sense.  Even more so if it has to fit everybody's expectations of if if they are different.
So at the end of the day I probably would rather like to drop Geany's implementation, that IIUC is far from perfect, and leave it completely to a good plugin.


---
¹ yes we are only a few, no we don't always have time, remember, or care so much about a feature, and yeah we sometime desperately hope someone else will take care of something.

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany-plugins/issues/281#issuecomment-197505486
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20160316/2e43d5a0/attachment.html>


More information about the Github-comments mailing list