[Geany-devel] Line operations

Eugene Arshinov earshinov at xxxxx
Sun Feb 5 12:51:08 UTC 2012


Hello all.

I have several suggestions and questions about certain line operations
implemented in Geany.

1) Recently I found that "move lines up/down" command does not work
properly for the last line not ending with a newline.  You can easily
check it yourself.  Couple of minutes ago I made a pull request [1]
with an implementation of `editor.c:move_lines()` which handles the
problem.  Dear unknown someone, please review and pull if it's okay.

[1]: <https://github.com/geany/geany/pull/21>

2) I want to raise a question, do we need a "join lines" command?  This
command would be a companion of the existing "reflow paragraph"
command, but in contrast with the latter, it would only join lines, but
not split them.

This command may be useful when, let's say, you have a document created
by someone else who sticks with line breaking and inserts \n at column
80.  Suppose that you prefer using line wrapping instead and want to
remove those \n in a peace of a document which you're editing.  The new
command would help you a bit.

Implementation of the new "join lines" command could use the bits of
code already written for "reflow paragraph" (though, those bits need to
be extracted/refactored first).  Moreover, I already implemented it
and, if the new command seems useful to anyone, I can put my
implementation in a pull request.

3) Here there should have been a point about some bug reports we have
in Geany bug tracker, referring to "reflow paragraph" glitches.  As
this message is already too long, I decided to designate a separate
message for that (later).

Thank you for reading :)  Please write your thoughts about 1) and 2)

--
Best regards,
Eugene.



More information about the Devel mailing list