The <b>justify</b> command is very useful Please consider having it co-operate with <b>vertical selection</b> so that justifying the comment on line 1 produces line 6 as opposed to line 8
![justifycomments](https://cloudgithubusercontentcom/assets/7548378/11841741/4de52b56-a3f7-11e5...)
Such a feature would useful in formatting code, for example producing line 5 instead of line 7:
![comment2](https://cloudgithubusercontentcom/assets/7548378/11841882/0493d3fc-a3f8-11e5...)
<b>Thanks!</b>
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/821
There is no "justify" command in Geany, do you mean "Reflow lines/block" ?
That command is a text reflow command, it has no knowledge of language syntax like comments. To make it handle reflowing comments would need knowledge of every language since they all have their own semantics. This might be a candidate for having filetype specific plugins for indentation and other formatting, but until then there are too many languages to have comment handling for each in the Geany core.
Your second example has even more language and style specific behaviour, reflowing the code, but not the comment, and again thats a plugin candidate not Geany core.
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/821#issuecomment-165249892
@elextr IIUC he meant to make reflow honor the rectangular selection, which could mostly end up like he suggests.
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/821#issuecomment-165258902
Hmmm, ok, thats closer and at least its not filetype specific, but the first would still leave the empty comment lines as well as line 5. And the second is very confusing, it has to compress the spaces when its wrapping, but still leave spaces to keep the comment in the same place. And what about comments on multiple lines? And lines that would otherwise be empty, should they be removed or filled with spaces?
Anyhow its probably still best as a plugin.
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/821#issuecomment-165281356
@elextr We know the comment characters for any file type so it ought to be possible to implement a generic solution (in the core). Unless I'm missing something? I'm talking about the first example only. I agree the second one is probably too specifc.
In fact, I've come across this annoyance multiple times too and I find it should be improved.
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/821#issuecomment-166695508
@kugel- see @b4n's comment.
Its not specifically that it leaves the comments, its what to do with anything before and after rectangular selection. They just happen to be comments in the example given.
I believe what you are after is a "reflow comments", and that would indeed be useful, but is a separate issue to this "reflow rectangular selection".
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/821#issuecomment-166734329
Yea, I'm mostly looking for reflow comments
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/821#issuecomment-166741564
I also support the call for reflow being able to respect/understand comments.
For me this arises regularly in Latex, where I can have something like:
This sentence presents idea two %but the old idea one is left as a comment and then the text goes on on the next line.
In this case, reflow will heavily mess up my text.
There also is this old issue: https://sourceforge.net/p/geany/bugs/685/ , which would call for also knowing about equations and not breaking them apart. But teaching reflow about comments would be a great start IMO..
--- 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/issues/821#issuecomment-231556845
github-comments@lists.geany.org