我使用 monaco.editor.create 方法来创建模型。问题是 monaco 正在将多行代码解析为 Windows 操作系统中的 \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);
Run Code Online (Sandbox Code Playgroud)
我希望摩纳哥编辑器请求我的 API 的值\n
我使用以下内容:
let textModel = monaco.editor.createModel("");
textModel.setEOL(0);
Run Code Online (Sandbox Code Playgroud)
文档:
| 归档时间: |
|
| 查看次数: |
1189 次 |
| 最近记录: |