Monaco-editor: How can I emulate click on line?

Created on 29 May 2018  路  1Comment  路  Source: microsoft/monaco-editor

I need to get focus on some line.
How can set focus to editor and place my cursor(carret) to certain position in editor?
Some sort of simulating user clicks to editor.
For example get editor focused in first line?

Most helpful comment

editor.setSelection(new monaco.Selection(1,2,1,2));
editor.focus();

Have you seen the API doc ?

>All comments

editor.setSelection(new monaco.Selection(1,2,1,2));
editor.focus();

Have you seen the API doc ?

Was this page helpful?
0 / 5 - 0 ratings