Giter Club home page Giter Club logo

Comments (3)

scriptum avatar scriptum commented on July 28, 2024

@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.

Btw, why is not this plug-in merged into the main Geany code? I don't find any reasons why it should not be.

Even more. There are three different implementations of autoclosing feature (core, addons plugin and autoclose plugin). It isn't easy to make Geany code modifications - there are almost 100 pending PRs, some of them are 4 years old.

from geany-plugins.

Akronix avatar Akronix commented on July 28, 2024

OK. So you think there's no a lot of chances that Geany's code could be modified to support matching multi-line comments?

from geany-plugins.

b4n avatar b4n commented on July 28, 2024

@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()).

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.

from geany-plugins.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.