how to make a line active/current

How do I scroll to a specific line and make it the current line with activeLine background?

I am using the following code to scroll editor to the line of interest (goToLineNum), but don’t know how to make that line active/current line:
var t = editor.charCoords({line: goToLineNum, ch: 0}, “local”).top;
var middleHeight = editor.getScrollerElement().offsetHeight / 2;
editor.scrollTo(null, t - middleHeight - 5);

Thanks

Set the cursor on it with something like setCursor.

1 Like