I’m using a marktext to mark up a piece of text in this way
fileInfo.files = CodeMirror.fromTextArea(myTextarea as HTMLTextAreaElement, options as any)
fileInfo.files?.markText({line:1,ch:1}, {line:20,ch:23}, {readOnly:true,className:“codemirrorText”});
this is class
.codemirrorText {
background-color: red !important;
font-size: 24px;
color: green;
}
But did not work in the plug-in, please know the friends tell me how to do, in advance in this thank you.
Another problem is that I use setValue() to set the updated text contents, but the order of display in the text is not consistent. For example, the text that would have been displayed at the beginning will be somewhere in the middle. When the content is initialized, the string is not processed, and the rule for newline is’ \r\n '. When I remove the ‘r’ ‘preserve’ \n 'format, it still does not display correctly, please tell me what to do.