[Geany-devel] Line operations

Colomban Wendling lists.ban at xxxxx
Sun Feb 5 19:50:38 UTC 2012

Le 05/02/2012 13:51, Eugene Arshinov a écrit :
> Hello all.

Hey Eugene,

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

I know this problem, but it needed a so big code refactoring it hurts (I
want as a proof the fact your rewrite is... huge), so... I just
postponed it.  Ok, shame on me.

I haven't reviewed the new code yet, but I'll do.  Just as a note,
Scintilla has a command to do that that suffers (suffered?) of the exact
same bug we had.  Maybe it'd be good to fix their copy and use the SCI
message in place of our code.

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

Not sure I see a use case for this (read: I probably wouldn't use it if
it simply removes the EOLs), but why not if some wants it.  But maybe
Scintilla already have a message for it and thus we'd only need to use it?


> 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.
> _______________________________________________
> Geany-devel mailing list
> Geany-devel at uvena.de
> https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel

More information about the Devel mailing list