The Code | Move Statement Up/Down actions are useful for reorganizing code lines, for example for bringing a variable declaration closer to the variable usage.

Select a code fragment and press &shortcut:MoveStatementUp; or &shortcut:MoveStatementDown;.

The following picture shows the initial location of a code fragment:

Move up down with arrows initial

The results of moving the selected fragment up:

Move up down with arrows up

And the results of moving the selected fragment down:

Move up down with arrows down

When nothing is selected in the editor, the line at the caret position will be moved.