[Geany-devel] Line operations

Eugene Arshinov earshinov at xxxxx
Sun Feb 19 07:02:32 UTC 2012

Hi there.

Quick overview - I posted a pull request [3] which removes `move_lines`
function and uses commands already available in Scintilla.  See below.

On Sun, 05 Feb 2012 20:50:38 +0100
Colomban Wendling <lists.ban at herbesfolles.org> wrote:

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

I didn't find those Scintilla commands (SCI_MOVESELECTEDLINES{UP,DOWN}
to be precise) because they are not mentioned in the official Scintilla
documentation [1], though they are of course mentioned in Scintilla.h.
For completeness, here is the feature request for Scintilla where those
commands came from - [2].

The commands indeed work similarly to our own `move_lines` function.  I
posted pull request #24 [3] which removes `move_lines` function and
leverages the commands.  I hope it can be committed so that I can
switch my effort of improving "Move lines" feature from Geany to


Best regards,

More information about the Devel mailing list