Using the `first()` and `last()` selection (according to position in doc) here is not correct behavior for multiple selections. This is a cool effect *when all selections are in the viewport*, but that may not be true.

Try this out with multiple selections that are too far apart to both fit in viewport -- the page jumps when you reverse line move direction, so it's not desirable.

The safe fallback behavior for multiple selections is to operate on the "current" (i.e. last added) selection, which you can get with `editor.getSelection()`.

You are welcome to try to implement "use first selection in viewport when move line up" and "use last line in viewport when line move down" behavior, but it will take a bit of work to determine which selection to use. Another option may be to only do this if all selections are in viewport.