"Inline" CSS

Even though it has been 5 years that this problem has been asked, I couldnt find a better solution than loraderon suggested so I have modified it a bit to make it work a little better.

editor.markText({ line: 0, ch: 0 }, { line: 0 }, { readOnly: true });
editor.on(‘change’, () => {
editor.markText(CodeMirror.Pos(editor.lastLine() - 1), CodeMirror.Pos(editor.lastLine()), { readOnly: true });
});
if (!textarea.value) {
editor.setValue(`{

}`);
}