Replies: 2 comments
-
See this example https://microsoft.github.io/monaco-editor/playground.html#interacting-with-the-editor-revealing-a-position on how to reveal a position in the editor, that you can modify like below, to reveal and select a range in the editor. // editor.revealPositionInCenter({ lineNumber: 50, column: 120 });
const range = {startLineNumber: 50, startColumn: 10, endLineNumber: 52, endColumn: 3};
editor.revealRangeInCenter(range);
editor.setSelection(range);
See this example https://microsoft.github.io/monaco-editor/playground.html#interacting-with-the-editor-listening-to-mouse-events |
Beta Was this translation helpful? Give feedback.
0 replies
-
@spahnke thanks for helping out! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We would like to keep selected line numbers in the URL so next time user refresh the browser, all selected lines are still selected.
Monaco-editor should have a way to capture click events and also allow to set default selected lines.
Beta Was this translation helpful? Give feedback.
All reactions