scrollIntoView command

scrollIntoView scrolls the view to the current selection or cursor position.

Use the scrollIntoView command

editor.commands.scrollIntoView()