monaco-editorvisual-studio-monaco

Monaco Editor : How to fix certain line in source code


How can I set a line fixed in Monaco Editor ?

One can edit the content before or after the fixed line. But she cannot edit or remove the fixed line.


Solution

  • It is not possible to lock (aka. read-only) individual lines. You can only set the entire editor to read-only.