我使用了monaco.editor.create方法来创建模型。问题是,在windows OS中将多行代码解析为\r\n格式。
我尝试在monaco.editor.create()的editorOptions中使用defaultEOL作为'LF‘。
let editorOptions = {
value,
quickSuggestions: { other: true, comments: true, strings: true },
language: language,
tabSize: tabSize,
...options
};
this._editor = monaco.editor.create(this._node, editorOptions);我希望monaco编辑器为我的API赋值\n
发布于 2019-09-13 05:52:55
我使用以下代码:
let textModel = monaco.editor.createModel("");
textModel.setEOL(0);文档:
https://stackoverflow.com/questions/56525822
复制相似问题