Neil Hodgson wrote:
i've added 2 new commands to the scintilla editor:

Editor::SelectionMoveDown (keys: <alt> + <shift> + <down>)
Editor::SelectionMoveUp (keys: <alt> + <shift> + <up>)

   There are actually 4 new commands in the patch: Alt+Up, Alt+Down,
Ctrl+Shift+Up, and Ctrl+Shift+Down.

Alt+Shift+Up/Down are already used for rectangular selection...

Behaviour:
if there is no selection the command moves a
the current line up/down. if multiple lines are
selected, these lines are moved up/down.

   I'm not sure this is needed enough to go in the core editor so am
interested in other people's opinions. I'd use drag and drop or cut
and paste for these operations. The commands can also be added by the
application if wanted.

This can be useful for small moves, since you don't need to clutter the clipboard nor to reach for the mouse, as lot of people like keyboard only operations.

The problem is to remember to use it...

Actually, we already have the Ctrl+T command to switch the current line and the previous one. This is useful, for example, when transforming a comment after code to a comment before the line:

  i++; // Increment i by one

Hit Return with caret before first /, type Ctrl+T, done...

  // Increment i by one
  i++;

Autoindent and save right-timming spaces take care of the rest.

But I rarely think to use it...

Note that Ctrl+T & Up/Down arrows can be used for similar result as the patch above, but only for moving one line (the patch allows to move blocks of lines) and at the cost of more keystrokes.

--
Philippe Lhoste
--  (near) Paris -- France
--  http://Phi.Lho.free.fr
--  --  --  --  --  --  --  --  --  --  --  --  --  --
_______________________________________________
Scite-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scite-interest

Reply via email to