moveVertically

fun moveVertically(view: EditorSession, sel: SelectionRange, forward: Boolean, extend: Boolean = false): SelectionRange

Move a selection range vertically by one line, keeping an approximate horizontal position.

Uses EditorSession.coordsAtPos to find current coordinates and EditorSession.posAtCoords to project to the target line.

Parameters

view

The editor view (for coordinate queries).

sel

The current selection range.

forward

If true, move down; if false, move up.

extend

If true, extend the selection rather than move the cursor.