serdarciplak / BlazorMonaco

Blazor component for Microsoft's Monaco Editor which powers Visual Studio Code.
https://serdarciplak.github.io/BlazorMonaco/
MIT License
449 stars 100 forks source link

How do I set the start line for my code editor using Blazor Monaco? #91

Closed BelloMary1 closed 1 year ago

BelloMary1 commented 1 year ago

By default the start line of the code within the editor is 1, let's say I want to set it to start from a different value, such as 37. How do I configure the start line?

serdarciplak commented 1 year ago

The JS editor does not support doing this with a construction option. But I think you can subscribe to the OnDidInit event of the editor instance, and use the SetPosition method there to set the cursor position on init.